Splunk Search

help on where clause

jip31
Motivator

hi

why my where condition doesnt works please?

 

`boot` 
| fields host Name Path DegradationTime 
| stats max(DegradationTime) as DegradationTime by Path 
| where DegradationTime>1
| eval "DegradationTime" = round(('DegradationTime' / 1000),0) 

 

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

kamlesh_vaghela
SplunkTrust
SplunkTrust
Yes..
I tried this..

| makeresults
| eval DegradationTime="100000" ,Path="C:"
| stats max(DegradationTime) as "DegradationTime" by Path
| eval "DegradationTime" = round(('DegradationTime' / 1000),0)
| where DegradationTime>1
| rename DegradationTime as "Degradation time (seconds)"

View solution in original post

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@jip31 

Can you please share sample OP from this? 

| fields host Name Path DegradationTime 
| stats max(DegradationTime) as DegradationTime by Path 
0 Karma

jip31
Motivator
Tags (1)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust
It looks you rename DegradationTime field.. Did you tried where condition before rename?? It's working for me.
0 Karma

jip31
Motivator

I dont understand

something like this??

 

| stats  max(DegradationTime) as "DegradationTime" by Path 
| eval "DegradationTime" = round(('DegradationTime' / 1000),0) 
| where DegradationTime>1 
| rename DegradationTime as "Degradation time (seconds)" 
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust
Yes..
I tried this..

| makeresults
| eval DegradationTime="100000" ,Path="C:"
| stats max(DegradationTime) as "DegradationTime" by Path
| eval "DegradationTime" = round(('DegradationTime' / 1000),0)
| where DegradationTime>1
| rename DegradationTime as "Degradation time (seconds)"
0 Karma

jip31
Motivator

yes it works now thanks

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

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 ...