Splunk Search

How to display field value into column?

Khuzair81
Path Finder

status=Auto, Manual

car= BMW, Honda, Audi

index * | stats count(status) as Total by car

Is there anyway I can get the results as shown in attached picture.

IMG_20220829_174714.jpg

 

 

 

 

 

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Use chart, not stats

| chart count as Total over car by status

View solution in original post

yuanliu
SplunkTrust
SplunkTrust

For fun,  Splunk 9 allows a special mode in foreach that can be used for this purpose.

| stats count as Total by car status
| foreach mode=multivalue status
    [eval <<ITEM>> = if(isnull(Total), 0, Total)]
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Use chart, not stats

| chart count as Total over car by status
Get Updates on the Splunk Community!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...