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!

Explore the Latest Educational Offerings from Splunk

At Splunk Education, we are committed to providing a robust learning experience for all users, regardless of ...

Meet Duke Cyberwalker | A hero’s journey with Splunk

We like to say, the lightsaber is to Luke as Splunk is to Duke. Curious yet? Then read Eric Fusilero’s latest ...

The Future of Splunk Search is Here - See What’s New!

We’re excited to introduce two powerful new search features, now generally available for Splunk Cloud Platform ...