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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...