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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...