Splunk Search

How to write the regex for host_regex for my sample data?

omgwut56k
Path Finder

I need some help building regex for host_regex.

Please and thank you!

/opt/splunk/SFTP/SYSTEM/daftm44de_sec.14-08-29.log
/opt/splunk/SFTP/SYSTEM/opd1_sys.14-08-27.log
/opt/splunk/SFTP/SYSTEM/opd9_sys.14-12-29

The host name is, for example:

oppd1_sys
daftme44de_sec
oppd9_sys

0 Karma

MuS
Legend

Hi omgwut56k,

based on the provided data, try this as regex:

\/([\w\d]+)\.

hope this helps ...

cheers, MuS

Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...