Forum Discussion
Kevin_Stewart
Jun 26, 2014Employee
You could also use a regex:
set str "test-tools-config.acme.com"
set foo [string range [regexp -inline {\-[^-.]+\.} $str] 1 end-1]
log local0. $foo
Grab the part of the string that starts with a dash, ends with a period, and does not contain either in the middle, then strip the dash and period from the resulting string.