Splunk Search

Query Help

gozdeyildiz
New Member

Hi,

I am trying to search logs from specific source and with specific name and to search IP found in previous search in all indexes.

Ex: index=firewall and name="malicious IP' (this will give a log with IP address and I want to search that IP address in all indexes.

Thanks in advance.
Bests,
Gozde

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @gozdeyildiz,
please try something like this (if the field is called IP in every index:

index=* [ search index=firewall name="malicious IP" | fields IP ]
| ...

If you cannot be sure that IP field has the same name in every index, you could try something like this:

index=* [ search index=firewall name="malicious IP" | rename IP AS query | fields query ]
| ...

In both the searches check if the number of results of subsearch is more or less than 50,000, because there's this limit in subsearches.

Ciao.
Giuseppe

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...