Splunk Search

Creating a Data Table from CSV

ezajac
Path Finder

I am new to Splunk and only really understand the STATS Functions.

I have some CSV files that contain the fields that contain average response times for some testing that is performed monthly. ("Date", "OperationName", "Duration", "When")

This is the function I am running and each line only has one line so this kind of works for what I want to present in Splunk. Is there a better way to do this?

index="perf_results" | stats avg(Duration) as Duration by OperationName, When

What is getting returned looks like this

OperationName When Duration
Event 1 May 165
Event 1 June 168
Event 1 July 110
Event 1 August 114
Event 2 May 686
Event 2 June 885
Event 2 July 777
Event 2 August 600

What I would like is a report that presents information like this:

OperationName May June July August
Event 1 165 168 110 114
Event 2 686 885 777 600
Event 3 1000 1004 1100 1000

Tags (3)
0 Karma
1 Solution

kristian_kolb
Ultra Champion

Try chart instead of stats;

... | chart avg(Duration) AS Duration over OperationName by When

Hope this helps,

Kristian

View solution in original post

kristian_kolb
Ultra Champion

Try chart instead of stats;

... | chart avg(Duration) AS Duration over OperationName by When

Hope this helps,

Kristian

kristian_kolb
Ultra Champion

While your soul is withering away at the slot machines, doused in cheap liquor - just think of all the fun I'll have with my Karma points.

😉

0 Karma

Drainy
Champion

Glad to see you take your win in your stride 😄

kristian_kolb
Ultra Champion

HAHA, .conf starts today, and you've been found wanting....

Drainy
Champion

Just to voice that this is the best answer, I cannot upvote it for political reasons 😉

Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...