Splunk Search

How to convert tabular data to a specific format?

mnj1809
Path Finder

Hello,

I've the following tabular formatted data:

mnj1809_0-1669922038675.png

How can I achieve the following:

mnj1809_1-1669922122511.png

Thanks in advance for your help.

@ITWhisperer

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Like this

Your search...
| stats list(country) as country list(count) as count by category region
| eventstats sum(count) as byRegion by category region
| eventstats sum(byRegion) as byCategory by category
| table category region country count byRegion byCategory

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

Like this

Your search...
| stats list(country) as country list(count) as count by category region
| eventstats sum(count) as byRegion by category region
| eventstats sum(byRegion) as byCategory by category
| table category region country count byRegion byCategory

mnj1809
Path Finder

Thanks for your prompt reply.
Sorry for the late reply as I was out of town. The solution is working fine for me.
@bowesmana 

0 Karma
Get Updates on the Splunk Community!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...