8/22/2023 0 Comments Splunk archiver appLibrary Album Count (Apple Music Library Album Count) index="applemusic" Library Artist Count (Apple Music Library Artist Count) index="applemusic" Artist != Compilation Library Genres (Apple Music Genre) index="applemusic" Kind!=Undefined Kind!="Purchased AAC audio file" Library Kinds (Apple Music Kind) index="applemusic" Kind!=Undefined Kind!="Purchased AAC audio file" Each search is listed with the Dashboard Section Name and the Search Name in parentheses:Įxample: Dashboard Section Name (Search Name) ![]() Each of these will be created from the Search app. I will build the searches in the order they appear on the dashboard as depicted at the top of this post (see Splunk Dashboard above). I didn’t notice until after capturing everything for this blog post. Note that I mis-spelled one here – it says “Aple” instead of “Apple”. To build the dashboard, 22 searches will be created. It will have the description “Apple Music Library and Playtime Statistics”: The single dashboard being built is called “Apple Music Statistics”. When building the dashboard, you do not need the elevated permissions required to import the data. Going to the Search app will allow you to see the raw data: Lastly, Splunk will show a summary and provide some options for exploring the newly imported data. Next, review the selections, and click Submit: If you want to use the searches I provide later, create and name the index “applemusic” (no spaces): This will mark all records with the current date and time: Next, Splunk doesn’t understand how to define the timestamp, so it gets set to current. This can be done using the picker or drag and drop: If “Add Data” doesn’t show up, your user doesn’t have the proper permissions. You’ll need to be logged into Splunk as a user with permissions to upload data. Now that the CSV is created, it can be pulled into Splunk. Once the results are displayed, the CSV file should be saved as well. Open iStats, ensure export to CSV is checked, select the exported XML file, and wait a few seconds. If you don’t use iStats, your mileage may vary. iStats extracts only what is needed from the XML. This included movies/videos, voice memos, playlists, etc. The second step is to transform the exported XML file to CSV, omitting the items that are not a targeted part of the analysis. To export the library from Apple Music, from the File menu, use the Library menu item, and the Export Library… sub menu item. The first step is to export the Apple Music library. The required fields in the CSV are (the ones in quotes are alpha and quoted): "Artist","Album","Track","Year","Genre",Plays,Skips,Size,Minutes,Seconds,Milliseconds,"Bitrate","Kind"Īn example of the data: "Candlebox","Candlebox","Far Behind","1993","Hard Rock",14,0,36579379,4,59,666,"971","Apple Lossless audio file" If you don’t want to use iStats, fine, however you will need a similar CSV. Without iStats, you may not be able to fully replicate what I’ve done here with accurate results. Note there is only one major section of the exported Apple Music library XML file that should be transposed into the CSV file – there is other stuff in the XML you don’t want to be part of the analysis. To get the data into Splunk, I used the CSV export from my iStats program. Each section has a title that describes what it represents: The only comment I will make in comparing the two is that it was much easier to create the Splunk dashboard.įirst, let’s see the Splunk dashboard. I did create a dashboard in Elastic, but didn’t make the effort to blog about it. In the most recent update (linked above) I added the ability to export each track to CSV so I could pull the data into Elastic, another tool similar to Splunk. There are 22 searches with corresponding visual reports built into a single dashboard. This post will demonstrate the searches and dashboard I built in Splunk to provide analytics on my library. My Apple Music Library is an 18MB XML file when exported, with roughly 9,000 songs. While iStats does exactly what I need, I was curious how Splunk could provide any additional insights as it has a far greater capability to analyze big data. The previous blog posts for iStats are here: ![]() I was interested in seeing most played tracks, artists, and albums, and other statistics. ![]() iStats was designed to provide play and library analytics for my iTunes (now Apple Music) library. In the past I wrote a Javascript application called iStats, which I posted about a couple of times. I have it setup at home, primarily to learn, and sometimes to try new things. Splunk allows you to download and run it freely with a limited ingest, which is perfect for home use and/or training. I’ve been involved with it for the past few years at work. Splunk is a fantastic data analytics tool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |