Splunk Search

How to get the where condition from a lookup source, work?

jip31
Motivator

Hello

I dont understand why my "where" condition doesnt work
could you help me please?

| inputlookup host.csv 
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT HealthState00 |where HealthState00 > 99 | stats count by host
0 Karma
1 Solution

jip31
Motivator

But i have something strange again
I m doing where HealthState00 < "95,00"
It well displays resulst < to 95 but also events with HealthState00 = 100!
why?

| inputlookup host.csv 
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT HealthState00 | where HealthState00 < "95,00"| table host HealthState00 population

View solution in original post

0 Karma

jip31
Motivator

But i have something strange again
I m doing where HealthState00 < "95,00"
It well displays resulst < to 95 but also events with HealthState00 = 100!
why?

| inputlookup host.csv 
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT HealthState00 | where HealthState00 < "95,00"| table host HealthState00 population
0 Karma

jip31
Motivator

I found!
I added brackets like this where HealthState00 > "90,00"

0 Karma

Vijeta
Influencer

@jip31 Just remove stats count by host and see if it gives you any results.

0 Karma

jip31
Motivator

when I m doing | inputlookup host.csv
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT HealthState00
I have results

0 Karma

somesoni2
Revered Legend

Does your PanaBatteryStatus.csv lookup has field called Hostname00 and host.csv has a field host?

0 Karma

jip31
Motivator

Yes for both

0 Karma

somesoni2
Revered Legend

Ok.. Does the field values match exactly (by default the lookup match is case sensitive) between two lookup table files (Hostname00 from PanaBatteryStatus.csv and host from host.csv)? Also, when you say the where condition doesn't work, does it not filter the data OR it's filtering all data?

0 Karma

jip31
Motivator

yes they match exacly
when I add the where conditions I have any results

0 Karma

lakshman239
Influencer

add 'host' after OUTPUT as you are using in stats

0 Karma

jip31
Motivator

when I m doing | inputlookup host.csv
| lookup PanaBatteryStatus.csv "Hostname00" as host OUTPUT HealthState00
I have results
but if I add host after output, I have no results

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...