Splunk Search

Adding field to results of count querry

TomCollick
Explorer

How would I add field x to the results of count(y) as z so that the results are
x z count(y)? I know it is simple but it eludes me.
thank you

Tags (1)
0 Karma

RicoSuave
Builder

try this

mysearch | stats count(y) AS COUNTy | eval z=(COUNTy+x) | table x z COUNTy

RicoSuave
Builder

Awesome, please accept my answer 😄

0 Karma

TomCollick
Explorer

This worked thank you

0 Karma
Get Updates on the Splunk Community!

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...

Unlock Instant Security Insights from Amazon S3 with Splunk Cloud — Try Federated ...

Availability: Must be on Splunk Cloud Platform version 10.1.2507.x to view the free trial banner. If you are ...