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!

Simplifying the Analyst Experience with Finding-based Detections

    Splunk invites you to an engaging Tech Talk focused on streamlining security operations with ...

[Puzzles] Solve, Learn, Repeat: Word Search

This challenge was first posted on Slack #puzzles channelThis puzzle is based on a letter grid containing ...

[Puzzles] Solve, Learn, Repeat: Advent of Code - Day 4

Advent of CodeIn order to participate in these challenges, you will need to register with the Advent of Code ...