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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Rounding off the Splunk Dashboard Contest

What does a contest-winning Splunk dashboard look like? In this case, it isn't in a browser tab at all. It ...

A Four Part Event Series: AI + Observability: AI Agents, LLMs, Apps, & Infrastructure

AI &#43; Observability: AI Agents, LLMs, Apps, & Infrastructure The rapid evolution of artificial intelligence ...