Hi All
I am using custom logic in dashboard XML so that Splunk can choose the filter ( AND , OR ) based on the input given.
Here is my dashboard XML which was working fine or giving the right events in these scenarios:
Only value of Transaction Id given with Anonymous Account Id left blank. ( splunk going for OR filter )
Only value of Anonymous Account Id given with Transcation Id left Balnk. ( splunk going for OR filter )
Both Transaction Id and Anonymous Account Id given with having both those values existing in the events. ( splunk going for AND filter )
Not working in these scenarios:
Both Transaction Id and Anonymous Account Id given with not having both those values in the events. ( splunk going for OR filter )
So, In the above not working scenario the Splunk is going for ( OR ) filter which should be an ( AND ) filter.
Thank you in Advance.
<form>
<label>Test</label>
<fieldset submitButton="true" autoRun="true">
<input type="text" token="transactionid" searchWhenChanged="true">
<label>Transaction Id</label>
<default></default>
</input>
<input type="text" token="anonymousaccountid" searchWhenChanged="true">
<label>Anonymous Account Id</label>
<default></default>
</input>
<input type="time" token="time">
<label>Monitoring Time</label>
<default>
<earliest>-15m</earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<search>
<query>index=kubernetesservices splunk_server_group=aws_w transactionId="$transactionid$" AnonymousAccountId="$anonymousaccountid$"
| head 1</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
<done>
<!-- No Results found by performing AND, hence change the filter to OR -->
<condition match="$job.resultCount$==0">
<set token="filterType">OR</set>
</condition>
<!-- Result/s found by performing AND, hence retain the filter to AND -->
<condition>
<set token="filterType">AND</set>
</condition>
</done>
</search>
<row>
<panel>
<single>
<title>Total Event Count for Given Transaction Id / Anonymous Account Id</title>
<search>
<query>index=kubernetesservices splunk_server_group=aws_w transactionId="$transactionid$" $filterType$ AnonymousAccountId="$anonymousaccountid$" | stats count as Idcount </query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
</search>
</single>
</panel>
</row>
<row>
<panel>
<event>
<title>Detailed Events for Given Transaction Id / Anonymous Account Id</title>
<search>
<query>index=kubernetesservices splunk_server_group=aws_w transactionId="$transactionid$" $filterType$ AnonymousAccountId="$anonymousaccountid$" </query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
</search>
</event>
</panel>
</row>
</form>
... View more