Splunk Search

How do I invert the x and y-axis in my chart?

andrewtrobec
Motivator

Hello,

I'm trying to flip the x and y axis of a chart so that I can change the way my data is visualized. As it stands, the chart command generates the following table:

... | chart sum(January), sum(February), sum(March), sum(April), sum(May) by Activity

Activity,January,February,March,April,May
Running,31,63,35,54,1
Jumping,53,97,81,76,13
Crawling,64,13,81,105,36

What I'd like to do is be able to flip it so that the months (currently field names) become column values for a new column called "Month" and the activities become fields with and end result:

Month,Running,Jumping,Crawling
January,31,53,64
February,63,97,13
March,35,81,81
April,54,76,105
May,1,13,36

Is this at all possible?

Thank you!

Andrew

0 Karma
1 Solution

sundareshr
Legend

Try this

.. | chart sum(January), sum(February), sum(March), sum(April), sum(May) by Activity | untable Month Activity Data | xyseries Activity Month Data

View solution in original post

sundareshr
Legend

Try this

.. | chart sum(January), sum(February), sum(March), sum(April), sum(May) by Activity | untable Month Activity Data | xyseries Activity Month Data

jkat54
SplunkTrust
SplunkTrust

Might also like "| transpose" although it requires renaming the columns.

0 Karma

andrewtrobec
Motivator

Short and sweet, thank you so much!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...