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

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...