Splunk Search

help to display fields in a table

jip31
Motivator

HI
I use the search below in order to count errors by Product and source
TOTO
(Source="Hang" OR Source="Error")
| search Product=*
| stats count as count by Product Source

But what I need is to display the colum like this :
Product Hang Errors count
I have tested with transpose but it doenst works
thanks for your help

Tags (2)
0 Karma
1 Solution

HiroshiSatoh
Champion

How's this?

(Source="Hang" OR Source="Error")
| search Product=*
| stats count(eval(Source="Hang")) as Hang,count(eval(Source="Error")) as Error,count  by Product

View solution in original post

0 Karma

manjunathmeti
SplunkTrust
SplunkTrust

[updated]: Are you looking for something like this? If you also need total count.

Product      Hang       Errors     count
x              5          10         15
y              2           0          2

If yes, then you can use xyseries:

(Source="Hang" OR Source="Error") Product=*
| stats count by Product Source
| xyseries Product Source count
| fillnull value="0"
| eval count = Hang + Error
0 Karma

HiroshiSatoh
Champion

How's this?

(Source="Hang" OR Source="Error")
| search Product=*
| stats count(eval(Source="Hang")) as Hang,count(eval(Source="Error")) as Error,count  by Product
0 Karma

jip31
Motivator

It seems to be ok thanks

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...