Splunk Search

Query question between 2 indexes

christay
New Member

Hi Guys,

Can i check how can i craft the query given the following condition.

I have 2 indexes IndexA and IndexB with the following filed in each index.

Example as follows :

IndexA

Field contains :

srcIP = 10.10.10.10
cat = malicious IP 100%

IndexB

Field contains  :

TrueClientIP = 10.10.10.10

The objective of my query is to compare "TrueClientIP" under Index B against "srcIP" under IndexA and the condition that if the "cat" field under IndexA is tag under malicious IP it will return me the count .

How can i craft the above query ?

Thanks for the help.

 

0 Karma

to4kawa
Ultra Champion

index=IndexA OR index=IndexB | eval ip=coalesce(srcIP,TrueClientIP) | rex field=cat "(?<malicious>malicious)" | stats count(malicious) by ip

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  &#x1f680; Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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