Note this question relates to the replace eval function, not the replace search command. I've been referring to the documentation in https://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/CommonEvalFunctions
My requirement is to take a list of space-delimited values in an input field and turn it into a comma-separated list for passing to the search For example, a b c d in the input should be transformed to ('a','b','c','d'). Here's my input definition from the dashboard:
<input type="text" searchWhenChanged="false" token="order_number">
<label>Order Number</label>
<default></default>
<change>
<eval token="order_number_q">if($value$=="","","('"+replace(ltrim(rtrim($value$))," +","','")+"') ")</eval>
</change>
</input>
The issue is that only the first instance of the space is replaced - so with my example above I'm ending up with ('a','b c d')
Documentation on the replace evaluation function is light, and I haven't found anyone else in Splunk Answers experiencing this behavior.
... View more