Splunk Search

How to list out the field in tabular format?

AL3Z
Builder

Hi All,

How do we list out the fields in tabular format..
Eg:

hostname  action  
windows     allowed
                        deny
                        accept

---------------->  
hostname    action

windows    allowed
windows    deny
windows    accept

in this way I need a search in tabular format 

Thanks..

 

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @AL3Z,

sorry but I don't understand: do you want the first or the second?

anyway, for the first, you need something like this:

<your_search>
| stats values(action) AS action BY host

in the second you have

<your_search>
| stats count BY host action
| fields - count

if you also want the count it's a little more complicated:

<your_search>
| stats count BY host action
| eval column=action."|".count
| stats values(column) AS column BY host

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

&#x1f5e3; You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...