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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...