Splunk Search

How do I edit my search to make a change to the resulting output?

puneetkharband1
Path Finder

My search:

index="ABC" sourcetype=* Customers=ABCD | top limit=1 Customers

Output is:

ABCD  233322

I want only 233322 to display as a stat because I am displaying it on a page for each customer

So please suggest the best way to display this.

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Try this:

index="ABC" sourcetype=* Customers=ABCD | top limit=1 Customers | fields - Customers

View solution in original post

fdi01
Motivator

try like:

index="ABC" sourcetype=*  | stats count(eval(Customers="ABCD"))  as "count of ABCD"
0 Karma

puneetkharband1
Path Finder

I am sorry I tried this but this gives me 0 value 😞

0 Karma

stephanefotso
Motivator

Hello! Try this:

index="ABC" sourcetype=* Customers=ABCD | top limit=1 Customers |table count

Thanks

SGF

puneetkharband1
Path Finder

This works too !!

0 Karma

stephanefotso
Motivator

Thanks. And i was thinking that you was only look at the count value 233322. Isn't it? Because i think that the top command will give the count and also the percent fields!

SGF
0 Karma

woodcock
Esteemed Legend

Try this:

index="ABC" sourcetype=* Customers=ABCD | top limit=1 Customers | fields - Customers
Get Updates on the Splunk Community!

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 ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...