Real-time Monitor Notifications

This is normal and has to do with how the client fetches different parts of the recording file when seeking.

as redirected here from you, is there any complete documentation for DVR Events API?

Your json file is no longer available. Could you prepare some other for me and tell me what you want to achieve since you don't want to be programmer, I can play with this:)

There is no documentation. But you can run this command and see how it works:

curl http://x.x.x.x:8089/dvr/events/subscribe

I swear these activity events used to be logged in the DVR log?
I'm trying to get timestamps and so far the closest I got was having curl dump an ascii trace with timestamps to a log file.
curl --trace-time --trace-ascii "logfilename" http://x.x.x.x:8089/dvr/events/subscribe

I can also get timestamps from my browsers web console inspector, but that's not viable for long term logging.

curl -Ns http://x:8089/dvr/events/subscribe | jq -c ".time = now"
{"Type":"hello","Version":"2020.11.26.2332","time":1606517206.585699}

curl -Ns http://x:8089/dvr/events/subscribe | jq -c ".time = (now | todate)"
{"Type":"hello","Version":"2020.11.26.2332","time":"2020-11-27T22:48:05Z"}

1 Like

Elegant!
This puts the date/time first, just how I wanted it.
jq -c -S ".At = (now | todate)"

{"At":"2020-11-28T00:25:26Z","Type":"hello","Version":"2020.11.26.0632"}
{"At":"2020-11-28T00:26:58Z","Name":"6-scanner","Type":"activities.set","Value":"Scanning for local content."}
{"At":"2020-11-28T00:26:58Z","Name":"6-scanner","Type":"activities.set","Value":"Scanning for movies in /volume1/arkives/testMovies"}
{"At":"2020-11-28T00:26:58Z","Name":"6-scanner","Type":"activities.set","Value":"Scanning for TV shows in /volume1/arkives/testTV Shows"}
{"At":"2020-11-28T00:26:58Z","Name":"6-scanner","Type":"activities.set"}
{"At":"2020-11-28T00:26:58Z","Name":"3-processor","Type":"activities.set","Value":"Processing newly recorded files."}
{"At":"2020-11-28T00:26:59Z","Name":"3-processor","Type":"activities.set"}

Thank You

3 Likes

Is there any way using jq to prepend (insert) the time as the first key:value pair in the object?

i.e. go from this
{"Type":"hello","Version":"2020.11.26.0632","time":"2020-11-28T05:06:45Z"}
to this
{"time":"2020-11-28T05:06:45Z","Type":"hello","Version":"2020.11.26.0632"}

Right now I'm sorting the object keys with the -S option and using the key 'At' to make it sort first.
I would prefer to keep the original unsorted object, but prepend instead of appending the time to the object.

I've previously written some scripts using curl and js to extract and sort things, but I read through the "js manual" until my head hurt tonight and nothing jumped out at me :man_shrugging:

Curious what this event is that occurs every 3 hrs.
Taking out the Trash?

{"At":"2020-11-28T07:15:05Z","Name":"5-pruner","Type":"activities.set","Value":"Pruning expired recordings."}
{"At":"2020-11-28T07:15:05Z","Name":"5-pruner","Type":"activities.set"}
{"At":"2020-11-28T10:15:05Z","Name":"5-pruner","Type":"activities.set","Value":"Pruning expired recordings."}
{"At":"2020-11-28T10:15:05Z","Name":"5-pruner","Type":"activities.set"}
{"At":"2020-11-28T13:15:05Z","Name":"5-pruner","Type":"activities.set","Value":"Pruning expired recordings."}
{"At":"2020-11-28T13:15:05Z","Name":"5-pruner","Type":"activities.set"}

Yes that is trash.

The order of keys in the json is meaningless, so the sort trick seems best.

1 Like