How to extract the nth letter from the host using regular expression?
Sample hosts are :-
host=abcdefpghijkl11 (prod )
host=abcdefsghijkl12 (stg)
host=abcdefdghijkl13 (dev)
Try like this. e.g. if you want to extract 10th character,
your base search | eval mychar=substr(host,10,1)
Alternatively,
your base search | rex field=host "^\w{9)(?<mychar>\w)"
Try like this. e.g. if you want to extract 10th character,
your base search | eval mychar=substr(host,10,1)
Alternatively,
your base search | rex field=host "^\w{9)(?<mychar>\w)"
Thanks !...