Splunk Search

How can I add new columns and name them by result or subsearch?

millie
Engager

Hi!
I would like to draw a chart with stacked bars , but I don't know how to add columns depend on result. for example, I first search and get the result as:

fieldA fieldB
A 1
B 2
C 3
D 4

But for drawing the chart, I need a result table like this, fields named by the result I got :

fieldA A B C D
dummy 1 2 3 4

The result might not be ABCD only. How could I do something like this? Thanks

Tags (2)
1 Solution

millie
Engager

Problem has been solved now, I've found a search command called "xyseries". I search as:

search ... | xyseries fieldA fieldB fieldB | addcoltotals labelfield=fieldA label="dummy" | where fieldA="dummy"

View solution in original post

0 Karma

millie
Engager

Problem has been solved now, I've found a search command called "xyseries". I search as:

search ... | xyseries fieldA fieldB fieldB | addcoltotals labelfield=fieldA label="dummy" | where fieldA="dummy"

0 Karma

ppablo
Retired

Hi @millie be sure to accept your answer so other users know it's correct when searching for similar issues 🙂

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...