Tutorial: Get/Export playback logs
Tutorial: Get Playback Logs
In order to retrieve playback logs via API, we will need to use the getPlaybackLogs
query. Search the Reference for the getPlaybackLogs
query.
getPlaybackLogs
requires GetPlaybackLogsInput
type. The input is totally optional. If you don't send any input by default you will receive logs for the past week.
(See the GetPlaybackLogsInput fields)
1.limit
. You can set how many logs you want to be returned. Default value is 5000
NOTE:
limit
cannot exceed more than 5000.
startTime
andendTime
indicate the range for your log query. By default, it is set to last7
days withstartTime
being currentDateTime - 7 andendTime
as currentDateTime.
NOTE: The values are timestamps with
nanosecond
precisionUTC
direction
determines order of the logs. It can haveforward
orbackward
as inputs,forward
retrieves logs in ascending order andbackward
in descending. Default value isdescending
and you will get the most recent logs firstfilterParams
provides a wide range of options which can be used to filter logs by a specific screen/content/space etc., By default no filters are applied (See the GetLogsFilterParams fields)Most of the fields are self-explanatory. Few odd ones are:
keyword
: This acts like a universal search, you can query by any keyword like Content name,Screen name,Space etc.,type
: Filter logs by type can beinfo
,error
message
: Filter by messages likestart
,finish
source
: If a content is being played from a playlist or a channel, you can filter usingplaylist
,channel-zone
name
: Name of the contentconsumer
: Filter logs by addingstudio
filter to get onlystudio
logs. By default removing this filter will get you all logs
NOTE: All filters in
filterParams
can take multiple values. Meaning you can query multiple screens/spaces/content names in a single API call.
query{getPlaybackLogs(input:{limit:500,filterParams: {"screenName": ["Lobby Screen","Reception"],"spaceName":["London","Bangkok"]}}) {statusdata}}
Tutorial: Export Playback Logs
In order to export playback logs, we will need to use the exportPlaybackLogs
query. Search the Reference for the exportPlaybackLogs
query.
exportPlaybackLogs
requires ExportPlaybackLogsInput
type. The input is totally optional. If you don't send any input by default you will receive logs for the past week.
(See the ExportPlaybackLogsInput fields)
All the input data for querying exportPlaybackLogs
is similar to getPlaybackLogs
. Get playback logs retrieves data as a JSON
response where as export logs gives you in CSV string
format.
query{exportPlaybackLogs(input:{limit:500,filterParams: {"screenName": ["Lobby Screen","Reception"],"spaceName":["London","Bangkok"]}})}
Graphql API doesn't support other content-types than application/json
so the response will come as a string and columns with comma(,)
separated values, /n
can be used to identify the next row of CSV file. Sample response is attached below.
{"data": {"exportPlaybackLogs": "\"timestamp\",\"type\",\"message\",\"spaceId\",\"spaceName\",\"screenId\",\"screenName\",\"platform\",\"contentId\",\"contentType\",\"name\",\"appid\",\"appname\",\"instanceId\",\"appViewerUrl\",\"viewUrl\",\"source\",\"channelZoneId\",\"channelId\",\"channelName\",\"playlistId\",\"playlistName\",\"playbackType\",\"playerVersion\",\"studioPlayerVersion\"\n\"Oct 26, 2021, 9:26:10 AM GMT+00:00\",\"info\",\"Show Image test.jpeg\",,\"Default\",\"test-id\",\"Test Browser Player\",\"browser\",,\"image/jpeg\",\"test.jpeg\",,,,,,,,,,,,,,\n\"Oct 26, 2021, 9:26:10 AM GMT+00:00\",\"info\",\"Start playback\",\"test-id\",\"Default\",\"test-id\",\"Test Browser Player\",\"browser\",\"test-id\",\"file\",\"test.jpeg\",,,,,,\"playlist\",,,,\"test-id\",\"Test Gallery\",\"timeline\",\"test-id\","}}