Splunk Search

Host_Regex not working

edwardrose
Contributor

Hello All,

I know that there are lots of questions for host_regex not working. Here is mine.

[monitor:///var/log2/gns/nac/log*]
_TCP_ROUTING = gns_core_indexers
host_regex = /log\_/gm
index = remoteaccess
sourcetype = Aruba:CPPM:Syslog

And the files in the nac directory look very similar to below

log_svr-orw-nac-01
log_svr-cop-nac-04
log_svr-hop-nac-02

So I am not to sure why the regex isn't just removing the log_ and leaving the rest as the host name.

thanks
ed

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The host_regex attribute needs a capturing group. It's not clear what you want the regex to do, but perhaps this will get you started.

HOST_REGEX = log_(.*)
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The host_regex attribute needs a capturing group. It's not clear what you want the regex to do, but perhaps this will get you started.

HOST_REGEX = log_(.*)
---
If this reply helps you, Karma would be appreciated.
0 Karma

edwardrose
Contributor

Thanks that worked like a charm. I am not a very good regex person 🙂

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...