Splunk Search

How can I get the graph that only displays percentage when using timechart?

Min1025
Explorer

I have a query below that is showing "PriceChangeCount", "Total" and "PriceChangeRate" in graph, How can I get the graph that only displays the PriceChangeRate in graph?

index=xxx sourcetype=xxx|eval priceChangeCnt=case(Id=xxx,"Yes") | timechart span=1h count as Total, count(priceChangeCnt) as PriceChangeCount | eval PriceChangeRate=(PriceChangeCount/Total)*100

Tags (2)
0 Karma
1 Solution

adonio
Ultra Champion

try this:

index=xxx sourcetype=xxx
|eval priceChangeCnt=case(Id=xxx,"Yes") 
|bin _time span=1h 
| stats count as Total, count(priceChangeCnt) as PriceChangeCount by _time
| eval PriceChangeRate=(PriceChangeCount/Total)*100
| timechart span=1h max(PriceChangeRate) as m_PriceChangeRate

hope it helps

View solution in original post

0 Karma

adonio
Ultra Champion

try this:

index=xxx sourcetype=xxx
|eval priceChangeCnt=case(Id=xxx,"Yes") 
|bin _time span=1h 
| stats count as Total, count(priceChangeCnt) as PriceChangeCount by _time
| eval PriceChangeRate=(PriceChangeCount/Total)*100
| timechart span=1h max(PriceChangeRate) as m_PriceChangeRate

hope it helps

0 Karma

Min1025
Explorer

Hi adonio, many thanks! It works well.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...