Splunk Search

How to compare Field Values of Two Different Fields from Two Lookups?

atebysandwich
Path Finder
|inputlookup lookup1,csv
|fields IP Host_Auth
|lookup lookup2.csv IP output Host_Auth as Host_Auth.1

Some of the field values in each version of Host_Auth match and some don't. How can I find the events that do not match?

I've tried where Host_Auth != Host_Auth.1 and eval but nothing works

Labels (2)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

Let me take a guess: you can do yourself a favor by not naming fields with special characters.

|inputlookup lookup1,csv
|fields IP Host_Auth
|lookup lookup2.csv IP output Host_Auth as Host_Auth_1
| where Host_Auth != Host_Auth_1

When field name contains special characters, you need to use single quotes in order to dereference their values, like

|inputlookup lookup1,csv
|fields IP Host_Auth
|lookup lookup2.csv IP output Host_Auth as Host_Auth.1
| where Host_Auth != 'Host_Auth.1'

View solution in original post

0 Karma

yuanliu
SplunkTrust
SplunkTrust

Let me take a guess: you can do yourself a favor by not naming fields with special characters.

|inputlookup lookup1,csv
|fields IP Host_Auth
|lookup lookup2.csv IP output Host_Auth as Host_Auth_1
| where Host_Auth != Host_Auth_1

When field name contains special characters, you need to use single quotes in order to dereference their values, like

|inputlookup lookup1,csv
|fields IP Host_Auth
|lookup lookup2.csv IP output Host_Auth as Host_Auth.1
| where Host_Auth != 'Host_Auth.1'
0 Karma
Get Updates on the Splunk Community!

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...