Splunk Search

Regex Hostname for multiple scenario

Akmal57
Path Finder

Hi,

I have log which the field name is called "name". The regex cannot get the hostname from the name field because have multiple scenario. Eg as below:

(DR) HostA-AIX-172.0.0.0-root

01-HostA-10-Cambodia-Cisco_Router-10.0.0.0-root1

172.0.0.0-Malaysia-Windows Server 2016-HostA-admin

172.0.0.0 - HostA-Indonesia-Win2012-172.0.0.0-admin

3D-(DR) HostA-Win2003-172.0.0.0 [NAT IP 192.0.0.0] (dmin)

AD-HostA.local-srv_AB_CDD

HostA-India-Solaris10-172.0.0.0-root

These are the sample inconsistent log that we need to get Hostname. The highlighted one should we get for the hostname.

Please assist on this by creating new regex

Labels (3)
Tags (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

Have you any document which describes your naming policy? Or should we just guess which part are standard like 

  • (DR)
  • Country-Cisco_Router-<IP>-<content>
  • <IP>-Country-Server type-<host>-<user>

etc.

r. Ismo

0 Karma
Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Building Momentum: Splunk Developer Program at .conf25

At Splunk, developers are at the heart of innovation. That’s why this year at .conf25, we officially launched ...