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 the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

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