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!

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