Nagios Logserver integration : problem with filters
Posted: Mon Jan 25, 2016 8:53 am
I have used the NagiosXI's wizard for Nagios Logserver to configure on Nagios XI an alert that I defined a while ago on Nagios LS.
Right now, the alert on Nagios LS is green (no match).
the query string on Nagios LS is :
Which means give me the records containing "ERROR" AND that are from the source "HL7Processor".
The wizard on Nagios XI generated this command :
The problem is that when this command check is fired, the "AND" logic seems to becom an "OR" logic.
It indeeds find about 1300 matching records, while it should report 0.
And if I launch the command with only "+SourceModuleName:HL7Processor" and then only "+ERROR", I respectively get about 1000 and 300 matching records.
So, the bottom line is that the "AND" logic is replaced by "OR" when using that command. Is there any kind of syntax I should use to correct that?
Right now, the alert on Nagios LS is green (no match).
the query string on Nagios LS is :
Code: Select all
+SourceModuleName:HL7Processor +ERROR
The wizard on Nagios XI generated this command :
Code: Select all
check_nagioslogserver.php --url='http://vipnagioslog/nagioslogserver/' --apikey='20f34782f619f1620246f87911573e9f77d26b78' --minutes='10' --warn='1' --crit='5' --query='{"query":{"filtered":{"query":{"bool":{"should":[{"query_string":{"query":"+SourceModuleName:HL7Processor +ERROR"}}]}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"from":1430922548745,"to":1431008948746}}}]}}}}}'
It indeeds find about 1300 matching records, while it should report 0.
And if I launch the command with only "+SourceModuleName:HL7Processor" and then only "+ERROR", I respectively get about 1000 and 300 matching records.
So, the bottom line is that the "AND" logic is replaced by "OR" when using that command. Is there any kind of syntax I should use to correct that?