Splunk Search

How to show only top 10 records while using inputlookup csv file

ramani2383
New Member

index="logmon_logs" |top useother=f limit=10 CHKOUTErrorMSG by _time|timechart count by CHKOUTErrorMSG |inputlookup append=t chkouterrorNew.csv | sort -_time | outputlookup chkouterrorNew.csv

Above is the query I'm using to display a chart. My goal is in last 24 hrs time line what's the top 10 CHKOUTErrorMSG(this is field extractor).
Now, what is happening instead of showing only top 10 error message, the error message is getting appended and the error count is getting increased over the time. Can you please help me?

Tags (1)
0 Karma

diogofgm
SplunkTrust
SplunkTrust

If the lines you want get from the csv is the top you and do it like you have but in the inputlookup use also the "max" and "start" arguments. If not, instead of appending via the inputkooup, try to use the append [subsearch] command to get the csv data, filter it and then appending it.
something like:

index="logmon_logs" |top useother=f limit=10 CHKOUTErrorMSG by _time|timechart count by CHKOUTErrorMSG| append [|inputlookup chkouterrorNew.csv | <whatever you want to filter>]| sort -_time | outputlookup chkouterrorNew.csv
------------
Hope I was able to help you. If so, some karma would be appreciated.
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 ...