Action "Write to log" (Generic Event).
AnsweredHi!
I create a new event rule - "Generic Event", and choose action "Write to log".
As a result - I got message "WARNING : Bad request: No 'cameraId' params specified".
(If I choose "Show notification" - everything is Ok - blink green frame)
What is wrong with my request?
-
Official comment
Hi Andrej,
You need to specify the cameraID so the system knows which camera it should assign to the log.
You can do this with the &metadata={"cameraRefs":["<cameraId>"]} parameter.
The URL could look like this:
http://127.0.0.1:7001/api/createEvent?timestamp=2016-09-16T16:02:41Z&caption=CreditCardUsed&metadata={"cameraRefs":["3A4AD4EA-9269-4B1F-A7AA-2CEC537D0248","3A4AD4EA-9269-4B1F-A7AA-2CEC537D0240"]}You can find the cameraId in the 'Camera Settings' menu, tab 'Advanced'.
-
Hi!
But, of course, I read documentation, and I specify cameraID. Here is my URL:
http://localhost:7001/api/createEvent?caption=disconnect&metadata={"cameraRefs":["4ddc3348-f306-922f-099f-61155af0eafc"]}
I even set logLevel to "DEBUG", but in vain.
I've said already - when I choose "Show notification" - everything is Ok.
0 -
Hi Andrej,
The log level is unrelated to the event. It should work, independent of the level of the log.
If you paste the URL in your browser, does it work than?
If you like I'm more than happy to create a ticket of this request and we can investigate the issue via Teamviewer if you like?
Just let me know.0 -
Hi Norman!
I think I misunderstood. When I send event (via browser or script), it is logged in "Event Log" (with empty "Source").
But nothing appears in the log-file (by default .../networkoptix/mediaserver/var/log/log_file.log). More precisely - a message "WARNING : Bad request: No 'cameraId' params specified" appears.
I meant exactly that.
0 -
Hi Andrej,
Please check for typos in your URL.
Also, check the video I just created to show how it is done.
As offered before; I'm more than happy to turn this issue into a ticket and work with you via TeamViewer to get this resolved.
0 -
Hi Norman!
Could you show me part of your log-file (with event information)?
0 -
Hi Andrej,
Sure, you can find the Event Log via this LINK.
I have filtered the Event Log on 'Generic Event' and 'Write to Log'.0 -
Hi Horman!
Thanks for link.
I’ll ask differently: How can I distinguish between different events (different Caption or cameraID) by the log?
Is this information stored somewhere?
0 -
Hi Andrej,
In the event log, only the events are stored, it does not store the captions or cameraId.
What you could do is set up another rule for the event 'Generic Event' with the caption 'disconnect' and 'Bookmark' as the action. In this way, you can distinguish the various events with the corresponding footage.0
Please sign in to leave a comment.
Comments
9 comments