Splunk Search

How to compare field values ​​in two different indexes to see which match and do not match?

bruno_eduardo
Path Finder

How to compare field values ​​in different indexes? which returns "match" and "not match"
Same as vlookup functionality of Excel.

By using | join I get the "match" one, but how to can I get "not match"???

index=A* source="AB*" | rename "Field A" as name | eval name=lower(name) | join type=inner name [search index=B* |eval name=lower(name) |table name | sort name] | table name |sort name

1 Solution

sk314
Builder

Have you tried using the command 'set' like so:

set diff [index=A* source="AB*" | rename "Field A" as name | eval name=lower(name)| fields name] [search index=B* |eval name=lower(name) | fields name]

and 

set intersect [index=A* source="AB*" | rename "Field A" as name | eval name=lower(name)| fields name] [search index=B* |eval name=lower(name) | fields name]

For more information:
http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Set

View solution in original post

sk314
Builder

Have you tried using the command 'set' like so:

set diff [index=A* source="AB*" | rename "Field A" as name | eval name=lower(name)| fields name] [search index=B* |eval name=lower(name) | fields name]

and 

set intersect [index=A* source="AB*" | rename "Field A" as name | eval name=lower(name)| fields name] [search index=B* |eval name=lower(name) | fields name]

For more information:
http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/Set

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