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!

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

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