Hello @PickleRick @gcusello @isoutamo - thanks for your kind response. I am reframing my problem statement here: Refer below Sample events from the logs: 240108 07:12:07 17709 testget1:...
See more...
Hello @PickleRick @gcusello @isoutamo - thanks for your kind response. I am reframing my problem statement here: Refer below Sample events from the logs: 240108 07:12:07 17709 testget1: ===> TRN@instance2.RQ1: 0000002400840162931785-AHGM0000bA [Priority=Low,ScanPriority=0, Rule: Default Rule].
240108 07:12:07 17709 testget1: <--- TRN: 0000002400840162929525-AHGM00015A - S from [RCV.FROM.TEST.SEP2.Q2@QM.ABCD101]. I am having issues while fetching data from 2 stats (TestMQ and Priority_Level) count fields together. Below is the query: index=test_index=*instance*/*testget*
| rex "\: (?<testgettrn>.*) \- S from"
| rex "RCV\.FROM\.(?<TestMQ>.*)\@"
| eval Priority_Level=case(Priority="Low", "Low", Priority="Medium", "Medium", Priority="High", "High")
| stats count as TotalCount, count(eval(Priority_Level="Low")) as Low, count(eval(Priority_Level="Medium")) as Medium, count(eval(Priority_Level="High")) as High by TestMQ
| fillnull value=0 This gives me result like example below: TestMQ | TotalCount | Low | Medium | High
MQNam1 | 120 | 0 | 0 | 0
MQNam2 | 152 | 0 | 0 | 0
.. The problem is that I am getting "0" value for Low, Medium & High columns - which is not correct. I want to combine both the stats and show the group by results of both the fields. If I run the same query with separate stats - it gives individual data correctly. Case 1: stats count as TotalCount by TestMQ index=test_index=*instance*/*testget*
| rex "\: (?<testgettrn>.*) \- S from"
| rex "RCV\.FROM\.(?<TestMQ>.*)\@"
| eval Priority_Level=case(Priority="Low", "Low", Priority="Medium", "Medium", Priority="High", "High")
| stats count as TotalCount by TestMQ
Example Output:
TestMQ | TotalCount
MQName | 201 Case 2: stats count as PriorityCount by Priority_Level index=test_index=*instance*/*testget*
| rex "\: (?<testgettrn>.*) \- S from"
| rex "RCV\.FROM\.(?<TestMQ>.*)\@"
| eval Priority_Level=case(Priority="Low", "Low", Priority="Medium", "Medium", Priority="High", "High")
| stats count as PriorityCount by Priority_Level
Example Output:
Priority_Level | PriorityCount
High | 20
Medium | 53
Low | 78 Please help and suggest.