Dashboards & Visualizations
Highlighted

How to transpose 2nd column

Path Finder

I have query as shown below,

|stats count by stn stn_status

result:

stn stn_state count
stn1 completed 20
stn
1 In progress 2
stn1 failed 8
stn
2 completed 30
stn3 completed 10
stn
3 failed 10

expected results:

Stn completed In progress failed

stn1 20 2 8
stn
2 30
stn_3 10 10

Help me on this, Thanks in Advance.

Labels (1)
Tags (1)
0 Karma
Highlighted

Re: How to transpose 2nd column

Contributor

Replace your stats command with this:

| chart count over stn by stn_state

Note: I couldn't tell whether the correct field name is "stnstate" or "stnstatus" since you use both in your question. Use the correct field name in this chart command, and you should get the results you want.

Hope that helps!
rmmiller

View solution in original post

Highlighted

Re: How to transpose 2nd column

Path Finder

It Works, Thank you very much.

0 Karma
Highlighted

Re: How to transpose 2nd column

Esteemed Legend

Simply change stats to chart; no other changes are necessary.

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.