Splunk Search

Filtering data prior to timechart - finding values that are outside of filter

codekiln
Explorer

I'm seeking to make a spunk timechart of values that match a certain filter:

source="/var/log/bcore/ws_metric*" event="WsMetricConnectEventType.connect_end" duration_seconds < 60*60 | timechart p95(duration_seconds) span=5m 

Unfortunately, I'm clearly getting values that are longer than 60*60=3600 seconds. Many of the values for p95(duration_seconds) are actually somewhere in the range of 397k seconds. 

How can I actually filter the data going into timechart?

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

You can't do math in the search command.  Try where, instead or do the math yourself.

 

source="/var/log/bcore/ws_metric*" vent="WsMetricConnectEventType.connect_end" duration_seconds < 3600 
| timechart p95(duration_seconds) span=5m 


source="/var/log/bcore/ws_metric*" vent="WsMetricConnectEventType.connect_end" 
| where duration_seconds < 60*60 
| timechart p95(duration_seconds) span=5m 

 

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

You can't do math in the search command.  Try where, instead or do the math yourself.

 

source="/var/log/bcore/ws_metric*" vent="WsMetricConnectEventType.connect_end" duration_seconds < 3600 
| timechart p95(duration_seconds) span=5m 


source="/var/log/bcore/ws_metric*" vent="WsMetricConnectEventType.connect_end" 
| where duration_seconds < 60*60 
| timechart p95(duration_seconds) span=5m 

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...