- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to split/extract substring before the first - from the right side of the string
keshavgupta
Engager
05-10-2021
11:29 AM
Spoiler
How to split/extract substring before the first - from the right side of the field on splunk search
For ex: My field hostname contains
Hostname = abc-xyz
Hostname = abc-01-def
Hostname = pqr-01
I want to see like below .
abc
abc-01
pqr
Please help me.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ITWhisperer

SplunkTrust
05-10-2021
11:31 AM
| rex "(?<host>[^\-]+)\-"
