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!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...