<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to input value prefix/suffix and delimiter per value in a text token? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477340#M133981</link>
    <description>&lt;P&gt;That definitely helps, thanks a tonne for this. &lt;/P&gt;</description>
    <pubDate>Thu, 07 Nov 2019 23:01:18 GMT</pubDate>
    <dc:creator>donovanw</dc:creator>
    <dc:date>2019-11-07T23:01:18Z</dc:date>
    <item>
      <title>How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477335#M133976</link>
      <description>&lt;P&gt;Is it possible to add a per value prefix and suffix, and then divide by a delimiter to multiple values pasted into a textbox?&lt;BR /&gt;
I have an sql search that I've inserted a search token as part of an IN function. The end result I'm looking for is for a user to simply copy values from say an excel sheet and paste them into the textbox, at which point each value will get an apostrophe prefix/suffix and be delimited by a comma.&lt;/P&gt;

&lt;P&gt;Is this possible? The value prefix/suffix seems to be available on the multi-select insert, but not a standard textbox&lt;/P&gt;

&lt;P&gt;Effectively I want something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="text" token="serials"&amp;gt;
&amp;lt;label&amp;gt;Removed Serials&amp;lt;/label&amp;gt;
&amp;lt;valueprefix&amp;gt;'&amp;lt;/valueprefix&amp;gt;
&amp;lt;valuesuffix&amp;gt;'&amp;lt;/valuesuffix&amp;gt;
&amp;lt;delimiter&amp;gt;,&amp;lt;/delimiter&amp;gt;
&amp;lt;/input&amp;gt;
  &amp;lt;panel&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;| dbquery REPORT_DB "
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477335#M133976</guid>
      <dc:creator>donovanw</dc:creator>
      <dc:date>2019-11-07T20:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477336#M133977</link>
      <description>&lt;P&gt;Provide one input and expected query example&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477336#M133977</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2019-11-07T20:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477337#M133978</link>
      <description>&lt;P&gt;Heya, &lt;/P&gt;

&lt;P&gt;Yes of course. &lt;BR /&gt;
Input example into the textbox would be:&lt;/P&gt;

&lt;P&gt;218823181&lt;BR /&gt;
218824157&lt;BR /&gt;
218823185&lt;/P&gt;

&lt;P&gt;But I need it to be formatted like this for use:&lt;BR /&gt;
'218823181', &lt;BR /&gt;
'218824157', &lt;BR /&gt;
'218823185'&lt;/P&gt;

&lt;P&gt;Example of token use:&lt;BR /&gt;
| dbquery REPORT_DB "&lt;BR /&gt;
Select *&lt;BR /&gt;
[...]&lt;BR /&gt;
WHERE IP.Serial IN ($serials$)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 20:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477337#M133978</guid>
      <dc:creator>donovanw</dc:creator>
      <dc:date>2019-11-07T20:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477338#M133979</link>
      <description>&lt;P&gt;First off, you want double quotes instead of single.&lt;/P&gt;

&lt;P&gt;Second, if you'll never have spaces in the values, you don't need quotes at all, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;input type="text" token="serials"&amp;gt;
 &amp;lt;label&amp;gt;Removed Serials&amp;lt;/label&amp;gt;
 &amp;lt;delimiter&amp;gt;,&amp;lt;/delimiter&amp;gt;
 &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;... | where IP.Serial IN ($serials$)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Edit: Also, try changing &lt;CODE&gt;where&lt;/CODE&gt; to &lt;CODE&gt;search&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 21:37:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477338#M133979</guid>
      <dc:creator>jacobpevans</dc:creator>
      <dc:date>2019-11-07T21:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477339#M133980</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try the below code, if it works you can hide the first row with &lt;CODE&gt;depends&lt;/CODE&gt;.&lt;BR /&gt;
The input values should be space separated - 111 222 333&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form theme="dark"&amp;gt;
  &amp;lt;label&amp;gt;Serials&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input type="text" token="serials"&amp;gt;
      &amp;lt;label&amp;gt;Removed Serials&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults | eval input_sql="$serials$" | makemv delim=" " input_sql | mvexpand input_sql | eval input_sql="'".input_sql."'" | mvcombine delim="," input_sql | nomv input_sql&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-5m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="input_sql"&amp;gt;$result.input_sql$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|dbquery REPORT_DB "Select * from abc IP.Serial IN ($input_sql$)"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-5m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;accept the answer if it helps.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 22:35:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477339#M133980</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2019-11-07T22:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to input value prefix/suffix and delimiter per value in a text token?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477340#M133981</link>
      <description>&lt;P&gt;That definitely helps, thanks a tonne for this. &lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 23:01:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-input-value-prefix-suffix-and-delimiter-per-value-in-a/m-p/477340#M133981</guid>
      <dc:creator>donovanw</dc:creator>
      <dc:date>2019-11-07T23:01:18Z</dc:date>
    </item>
  </channel>
</rss>

