|
Hello, I am trying to build up a report using multiple stats, but I am having issues with duplication. I will do one search, eg index="ems" sourcetype="queueconfig" | multikv noheader=true | rename Column_1 as queues | stats list(queues) by instance It splits the events into single lines and then I use stats to group them by instance I have the following search that does the same for topics index="ems" sourcetype="topicconfig" | multikv noheader=true | rename Column_1 as topics | stats list(topics) by instance But now I want to join them into one search like this - index="ems" sourcetype="queueconfig" | multikv noheader=true | rename Column_1 as queues | join instance [search index="ems" sourcetype="topicconfig" | multikv noheader=true | rename Column_1 as topics] | stats list(queues),list(topics) by instance The issue that I am having is that at the time I join the topics in, the topics show up multiple times - it will join by instance, so for every queue line it fines it adds the topic line eg if queues are queue1, queue2 and topics are topic1, you will get queue1 topic1 queue2 topic1 So, when I do the lists, I get multiple not unique values in list(topics). If you add a uniq/dedup after, it doesnt have any effect. Is there a way to remove the duplicates? I am not approaching this the right way? Thanks |
|
Have you tried replacing:
with:
See Common Stats Functions in the online docs. It may also beneficial to do multiple stats operations. I couldn't test this, but here's a guess at slightly different approach:
Side note: You may find this search could be a good candidate for leveraging macros, since a large portion of it is duplicated. Sometime that helps readability and reusablility. Hello. Thankyou for your reply, this is interest - it has helped to remove that problem but has unmasked another. Where I have multiple values for the topic results, when it joins the searches together, it only links in the top value to each, rather than keeping all... any ideas? Eg. if topic results were sample, sample.topic, sample.topic2, only sample is passed in and kept in the joint search. If i run the topic search separately, I get multiple results for each instance!
(28 Apr '10, 16:40)
Hazel
To be honest, I've never really been able to make
(28 Apr '10, 17:32)
Lowell ♦
Maybe try using
(28 Apr '10, 17:37)
Lowell ♦
|
|
I have worked this out with 2 points
|
