Monitor Radio Station’s Playlists

At a recent Strata conference on Big Data, someone asked me if Splunk can be used to monitor what songs radio stations are currently playing and do analysis on the playlists. The answer is not only yes, but I happen to have created a reference implementation of this on Splunkbase. You can download the Monitor Radio Stations app for free and use it with your Splunk installation.

I use the YES API in a scripted input to gather events for each radio station that is being monitored in an user configurable 5 minute interval. The output of the scripted input is a readable XML format that lists the station name, artist, song and timestamp of the event among other things. Output only occurs if a song is playing as we really don’t care about indexing talk radio or commercials in this case. Instructions are provided on which text file to update to add your own radio stations. The main dashboard looks like this.

Radio Stations Statistics

Main Dashboard

For three of the panels, I am simply showing the type of genre that has currently been played in aggregate across all stations, a grouping of genre by US Timezone, and the last list of artists played by station. This is for the last 24 hours. Notice on the upper right corner there is a list of internet radio stations.  This panel is a HTML5 frame and is fully functional to play the station’s current broadcast right from the Splunk dashboard. I provided a few sample internet radio stations to start this off and instructions are provided for you to update this panel with more stations as you see fit. Also, not all browsers support HTML5 the same way and the note up top mentions what format should work in what browser. This is a bonus and has very little to do with the purpose of the app, which is to monitor radio stations playlists.

Anyway, I digress. Under dashboards, there is another Radio Stations Dashboard and it starts off with timecharts for count by artist, genre and station. Here it is.

Count by Artist, Genre, and Station

On the bottom part of the dashboard are panels for count by timezone, distinct count by genre, and a list of the last song and artist played by each station.

List last song and artist by station

List last song and artist by station

The most interesting part of the dashboards are when you click on any of the panel’s entries to get to the raw XML data. The fact that you can see the data and write your own custom searches and reports is one aspect. The part I like is the ability to create workflow actions on the fields to instantly get more information about the events. With this in mind I have created a few workflow field actions.

  • Get song lyrics using the song field.
  • Find song using the song field.
  • Play similar songs by artist using the artist field.
  • Find station using the station name field.

For instance, here is an example using the song field.

Workflow for Song Field

Each workflow action will attempt to go to an external site to get the lyrics, play the song, play similar songs by the artist, or find the radio station, which you may be able to listen to online. Since these are external sites to the app, there is no guarantee that the the particular song or artist will be found as not everything is playable or even searchable online.

That’s the tour of the app. It provides you a reference implementation to index, search, and analyze what songs are being played by your favorite US radio stations. This approach to index this list can also be applied to other media such as online music or video social networks. When I wrote this app, it was for entertainment purpose only. Hopefully, that is what it provides for you.

Nimish Doshi
Posted by

Nimish Doshi

Nimish is Director, Technical Advisory for Industry Solutions providing strategic, prescriptive, and technical perspectives to Splunk's largest customers, particularly in the Financial Services Industry. He has been an active author of Splunk blog entries and Splunkbase apps for a number of years.