Dashboards & Visualizations

How to present eventstats as timechart?

Marco204
Explorer

Hi there,

so I have a search which contains the field myMetric (done within field extraction).

I want to show a dashboard panel presenting only myMetrics on the y-axis and time on the x-axis.

I fail using "| timechart" since I am forced to use a statistic function or count (I want to show myMetric, not the count).

Using "| eventstats" my first problem was that the dashboard legend shows way to many fields, but I was able to remove them using "| fields -a,b,c". But the x-axis is labeled with "Time" instead of showing concrete datetimes.

So how can I archive this?

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

timechart, eventstats, stats, streamstats, and chart all require an aggregating function.  If the field being graphed is discrete enough (1 value per interval) then values(myMetric) should do the job.  Otherwise, use max(), min(), or avg(), whichever is most appropriate.

A possible alternative is the xyseries command, which converts selected fields into a format suitable for graphing.

 

<<your search to obtain 'myMetric'>>
| eval label="some text"
| xyseries _time label myMetric

 

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

timechart, eventstats, stats, streamstats, and chart all require an aggregating function.  If the field being graphed is discrete enough (1 value per interval) then values(myMetric) should do the job.  Otherwise, use max(), min(), or avg(), whichever is most appropriate.

A possible alternative is the xyseries command, which converts selected fields into a format suitable for graphing.

 

<<your search to obtain 'myMetric'>>
| eval label="some text"
| xyseries _time label myMetric

 

 

---
If this reply helps you, Karma would be appreciated.
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 ...