Splunk Search

Regular expression in Search

JensT
Communicator

Hello,

i want all records from some hosts.

How can i find records from hosts that match: host=chvj[34]04ld8[246] ?

Cheers,

Jens

Tags (1)

ziegfried
Influencer

The best solution would be to use a subsearch for this purpose:

* [ | metadata type=hosts | regex host="chvj[34]04ld8[246]" | fields host ]

Alternatively you could search for all events and filter based on the regex:

* | regex host="chvj[34]04ld8[246]"

JensT
Communicator

The second search is not suitable in our environment as we produce to much events.

But the first search seems to be okay. (not nice, tough)

Thanks,

Jens

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...