Hi;
I am trying to initiate the zmfilter.pl from a bash script but I need to be able to specify a particular event Id number.
What I am doing is (via a cron job) scanning the Events table for events with the Archived flag set. From this query, I build a file with a list of event Id's that are marked as Archived. I would then like to invoke the zmfilter.pl routine and supply a filter number AND an individual event Id. The filter would then upload the event (via FTP) to my archive machine.
I do have a filter that uploads archived events however, I would like to be able to do that on individual events one-at-a-time as opposed to uploading all archived events as a batch in a single zmfilter.pl call.
Any direction/help would be very much appreciated.
Invoke zmfilter.pl (to upload archived event) from CLI for specific event ID
Re: Invoke zmfilter.pl (to upload archived event) from CLI for specific event ID
OK, so it occurred to me that I could perhaps do the following:
The filters are maintained in the Filters table of the zm database. With this knowledge, I could:
1) Create a filter (in my case, filter Id27) that performs an upload of an event with the archived flag set AND with a specific Id.
2) Execute a mysql update on the Filters table for filter Id=27 on the Query_json field and then, via sed, substitute the Id number of the target event in the json string with the Id of the actual event I wish to upload.
3) With that complete, I could then use the cli to invoke the zmfilters.pl for filter 27
Make sense?
This is the result of the mysql query of the Query_json field in the Filters table of the zm database:
Query_json
{"terms":[{"attr":"Archived","op":"=","val":"1"},{"cnj":"and","attr":"Id","op":"=","val":"17436"}],"sort_field":"Id","sort_asc":"1","limit":"100"}
The filters are maintained in the Filters table of the zm database. With this knowledge, I could:
1) Create a filter (in my case, filter Id27) that performs an upload of an event with the archived flag set AND with a specific Id.
2) Execute a mysql update on the Filters table for filter Id=27 on the Query_json field and then, via sed, substitute the Id number of the target event in the json string with the Id of the actual event I wish to upload.
3) With that complete, I could then use the cli to invoke the zmfilters.pl for filter 27
Make sense?
This is the result of the mysql query of the Query_json field in the Filters table of the zm database:
Query_json
{"terms":[{"attr":"Archived","op":"=","val":"1"},{"cnj":"and","attr":"Id","op":"=","val":"17436"}],"sort_field":"Id","sort_asc":"1","limit":"100"}