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
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...