Splunk Search

How to modify the results in required format?

pavanae
Builder

I have a lookup query as follows

| inputlookup hosts.csv | rename hostname as my_hostname | table my_hostname

the results are follows

abcd
abcf.sjs.com
GHK
ghli.sjd.com

How can I modify my query to display the results in the below format for the above results

abcd
abcf
GHK
ghli

I want to remove the letters after dot in the results and just want to display the words like above

0 Karma
1 Solution

cmerriman
Super Champion

try adding this to the end:

|rex mode=sed field=my_hostname "s/\..*//g"

View solution in original post

cmerriman
Super Champion

try adding this to the end:

|rex mode=sed field=my_hostname "s/\..*//g"
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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