Splunk Search

What is the quickest way to find 100 max values of "Q" on huge log file?

indeed_2000
Motivator

Hi

What is the quickest way to find 100 max values of "Q" on huge log file?

 

here is my query:

index="myindex" |  rex "Q\[(?<Q>\d+) | stats max(Q)

 

here is the log:

13:58:34.999  Q[16]

 

Any idea?

Thanks

Labels (3)
Tags (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index="myindex" | rex "Q\[(?<Q>\d+)" | stats max(Q)
0 Karma

indeed_2000
Motivator

@ITWhispererThanks for answer. what is the different?

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The difference is mine will work, yours won't! 😀

"status" isn't a valid SPL command

Adding the field name to the rex expression identifies what the field is to be called.

0 Karma

indeed_2000
Motivator

@ITWhisperer actually i have performance issue, original post modified, I had typo.

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Rather than extracting the Q field at search time, you could consider extracting it at index time (transform/props .conf). That would at least remove the rex processing when trying to determine the max.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You could also try creating a summary index with the max values every minute for example, then look for the max in the summary index events rather than the raw events.

0 Karma

indeed_2000
Motivator

@ITWhisperer actually this is summary index 🙂 and still huge!
I try to use transform too but increase index time drastically !

Any other idea?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try a summary of the summary in larger timeslices.

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...