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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...