- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
utk123
Path Finder
06-22-2021
08:02 AM
I have a table with more than 50000 hostnames. I want to run a wild card for 5th & 6th character in a hostname list.
My list sample:
hostname |
SERVINBBB01 |
SERRCNAAA01 |
SERSSPBBC55 |
SERRINAAC98 |
SERWINSSS11 |
In my search result, I want to get list of hosts with IN in 5th & 6th location.
Results should be:
hostname |
SERVINBBB01 |
SERRINAAC98 |
SERWINSSS11 |
With asterisk(*) (example: *IN*) I am not able to get these results, as characters before and after 5th, 6th position are not same always.
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
06-22-2021
08:12 AM
Can you please try this?
YOUR_SEARCH
| regex hostname="(?<=^.{4})IN"
My Sample Search :
| makeresults | eval _raw="hostname
SERVINBBB01
SERRCNAAA01
SERSSPBBC55
SERRINAAC98
SERWINSSS11
"| multikv forceheader=1
| table hostname | regex hostname="(?<=^.{4})IN"
Thanks
KV
▄︻̷̿┻̿═━一
If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
utk123
Path Finder
06-22-2021
07:37 PM
Thanks KV, that works perfect.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
06-22-2021
08:12 AM
Can you please try this?
YOUR_SEARCH
| regex hostname="(?<=^.{4})IN"
My Sample Search :
| makeresults | eval _raw="hostname
SERVINBBB01
SERRCNAAA01
SERSSPBBC55
SERRINAAC98
SERWINSSS11
"| multikv forceheader=1
| table hostname | regex hostname="(?<=^.{4})IN"
Thanks
KV
▄︻̷̿┻̿═━一
If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.
