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