Splunk Search

regular expression to transformation

tdthorwald
Explorer

Hello,

In my linux data, two versions of the same hostname have turned up.
and .local.
Now I have been able to change the host field using both

eval host=replace(host, ".local", "")

and

rex mode=sed field=host "s/.local//g"

at searchtime, but I'm having issues setting up a field transformation.

What do I fill in? These are my guesses...

Destination app: search
Name: remove .local
Type: regex-based

Regular expression: ".local(?\S+)" <-- something like this?

Format: Big questionmark
Source Key: host?

Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...