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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...