Splunk Search

same field name exists in two indexes but with different values

moayadalghamdi
Path Finder

Hola splunker.

 

i performed a search using two indexes, but these tow indexes have different fields that uses the same field name, for example:

EmailServer: has the filed name message_subject

EmailProxy: has the filed name message_subject

 

i want to search using the  message_subject from the EmailServer

 

index=EmailServer OR index=EmailProxy NOT (src_ip=10.0.0.0/8 OR src_ip=192.168.0.0/16 OR src_ip=172.16.0.0/12 ) | table src_ip sender EmailServer.message_subject

 

 

Thanks ^_^^

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=EmailServer OR index=EmailProxy NOT (src_ip=10.0.0.0/8 OR src_ip=192.168.0.0/16 OR src_ip=172.16.0.0/12 ) 
| eval "EmailServer.message_subject"=if(index="EmailServer",message_subject,null)
| table src_ip sender EmailServer.message_subject
0 Karma

moayadalghamdi
Path Finder

Thanks for the answer Whisperer ^_^

 

this is the result i got:

moayadalghamdi_0-1622108074099.png

i forgot to tell you something, the src_ip field only exists at the EmailProxy, so the field sender is mutual,

so i want the stats to have:

 

EmailProxy.src_ip /// EmailServer.sender /// EmailServer.message_subject.

 

 

 

Thanks^_^

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=EmailServer OR index=EmailProxy NOT (src_ip=10.0.0.0/8 OR src_ip=192.168.0.0/16 OR src_ip=172.16.0.0/12 ) 
| eventstats values(src_ip) as "EmailProxy.src_ip" by sender
| eval "EmailServer.message_subject"=if(index="EmailServer",message_subject,null)
| table EmailProxy.src_ip sender EmailServer.message_subject
0 Karma

moayadalghamdi
Path Finder

w'ere getting close !

 

unfortunately the src_ip field is null:

 

moayadalghamdi_0-1622109360103.png

 

 

also the are empty records/Almost empty records:

moayadalghamdi_1-1622109411926.png

 

 

 

thanks so much for your time, i really appreciate it, please help with this one

 

 

^_^

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Can you clarify that the proxy will have events for user and src_ip and the server will have events for the user and subject, i.e. the exact same value for user exists in both sets of events? If not, how are you trying to correlate events from the two indexes?

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...