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 ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...