Dashboards & Visualizations

Set x-axis over multiple topic at line graph

Questioner
Path Finder

I have data like this,

 1st course2cd course3rd course4th course
A3422
B2513

 

I would like this data to look like this using a line graph,

Questioner_0-1690186551683.png

I'm trying to use this code, but the when i use multiple "over" data, an error occurs.

chart avg(x) as A over "1st course", "2cd course"

How Could I make this line graph? 

 

Labels (1)
Tags (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Your first column needs a field name (I have chosen User for this demonstration). Essentially, you need to use transpose.

| makeresults 
| fields - _time
| eval _raw="User	1st course	2cd course	3rd course	4th course
A	3	4	2	2
B	2	5	1	3"
| multikv forceheader=1
| table User *_course
``` The line above sets up demonstration data in line with your example ```
| transpose 0 header_field=User column_name=Course

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Your first column needs a field name (I have chosen User for this demonstration). Essentially, you need to use transpose.

| makeresults 
| fields - _time
| eval _raw="User	1st course	2cd course	3rd course	4th course
A	3	4	2	2
B	2	5	1	3"
| multikv forceheader=1
| table User *_course
``` The line above sets up demonstration data in line with your example ```
| transpose 0 header_field=User column_name=Course
0 Karma

Questioner
Path Finder

I solved it!

Thank you for your help 🙂

0 Karma
Get Updates on the Splunk Community!

Now Available: Cisco Talos Threat Intelligence Integrations for Splunk Security Cloud ...

At .conf24, we shared that we were in the process of integrating Cisco Talos threat intelligence into Splunk ...

Preparing your Splunk Environment for OpenSSL3

The Splunk platform will transition to OpenSSL version 3 in a future release. Actions are required to prepare ...

Easily Improve Agent Saturation with the Splunk Add-on for OpenTelemetry Collector

Agent Saturation What and Whys In application performance monitoring, saturation is defined as the total load ...