<?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 do I read comma separated inputs from a single text input box in a form? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417181#M27456</link>
    <description>&lt;P&gt;I think it might be easier in your case to use a subsearch instead of OR conditions.&lt;/P&gt;

&lt;P&gt;My idea was to extract the UniqueID from the events in the base search. (You could also use a field extraction instead of the rex command.) The subsearch will then match the UniqueIDs against the user input. Have a look at this dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Job Search&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="input_jobs"&amp;gt;
      &amp;lt;label&amp;gt;IDs (comma-separated)&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 count=3 | streamstats count
| eval Job_Name=case(count==1,"aaa.bbb.ccc.12345.dddddd.ccccc",count==2,"aaa.bbb.ccc.09876.dddddd.ccccc",count==3,"aaa.bbb.ccc.67543.dddddd.ccccc")
| rex field=Job_Name "aaa\.bbb\.ccc.(?&amp;lt;UniqueID&amp;gt;[\d]+)"
| search [| makeresults count=1
   | eval input="$input_jobs$"
   | eval input=replace(input," ","")
   | eval UniqueID=split(input,",")
   | mvexpand UniqueID | table UniqueID]&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&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;(You will need to replace the first two lines of the search query with something like: index=something sourcetype=something...)&lt;/P&gt;

&lt;P&gt;When my user input is "11111,67543,22222" then it will show the "aaa.bbb.ccc.12345.dddddd.ccccc" event.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Dec 2018 21:32:47 GMT</pubDate>
    <dc:creator>whrg</dc:creator>
    <dc:date>2018-12-02T21:32:47Z</dc:date>
    <item>
      <title>How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417180#M27455</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I am creating a form where a user can input a set of values separated by commas. Below are the details and example.&lt;/P&gt;

&lt;P&gt;I need to generate a table with a set of jobs along with some other information.&lt;/P&gt;

&lt;P&gt;The job name will have a unique ID. Those IDs will be provided as a comma separated input by the user.&lt;/P&gt;

&lt;P&gt;Job_Name=aaa.bbb.ccc.xxxxx(UniqueID).dddddd.ccccc&lt;/P&gt;

&lt;P&gt;So, the user input needs to be applied in the Job_Name field in a OR condition. Like below,&lt;/P&gt;

&lt;P&gt;Say example user imput is 12345, 09876, 67543&lt;/P&gt;

&lt;P&gt;I need to generate a search like index=something  sourecetype=something Job_Name=aaa.bbb.ccc.12345.dddddd.ccccc OR aaa.bbb.ccc.09876.dddddd.ccccc OR aaa.bbb.ccc.67543.dddddd.ccccc.&lt;/P&gt;

&lt;P&gt;Please help me out on this.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 20:45:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417180#M27455</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2018-12-02T20:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417181#M27456</link>
      <description>&lt;P&gt;I think it might be easier in your case to use a subsearch instead of OR conditions.&lt;/P&gt;

&lt;P&gt;My idea was to extract the UniqueID from the events in the base search. (You could also use a field extraction instead of the rex command.) The subsearch will then match the UniqueIDs against the user input. Have a look at this dashboard:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Job Search&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="input_jobs"&amp;gt;
      &amp;lt;label&amp;gt;IDs (comma-separated)&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 count=3 | streamstats count
| eval Job_Name=case(count==1,"aaa.bbb.ccc.12345.dddddd.ccccc",count==2,"aaa.bbb.ccc.09876.dddddd.ccccc",count==3,"aaa.bbb.ccc.67543.dddddd.ccccc")
| rex field=Job_Name "aaa\.bbb\.ccc.(?&amp;lt;UniqueID&amp;gt;[\d]+)"
| search [| makeresults count=1
   | eval input="$input_jobs$"
   | eval input=replace(input," ","")
   | eval UniqueID=split(input,",")
   | mvexpand UniqueID | table UniqueID]&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&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;(You will need to replace the first two lines of the search query with something like: index=something sourcetype=something...)&lt;/P&gt;

&lt;P&gt;When my user input is "11111,67543,22222" then it will show the "aaa.bbb.ccc.12345.dddddd.ccccc" event.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2018 21:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417181#M27456</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-02T21:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417182#M27457</link>
      <description>&lt;P&gt;@Kwip&lt;/P&gt;

&lt;P&gt;Can you please try this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
   &amp;lt;label&amp;gt;Job Search&amp;lt;/label&amp;gt;
   &amp;lt;fieldset submitButton="false"&amp;gt;
     &amp;lt;input type="text" token="input_jobs"&amp;gt;
       &amp;lt;label&amp;gt;IDs (comma-separated)&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; index=something sourecetype=something  [| makeresults | eval input="$input_jobs$" | eval Job_Name=split(input,",") | mvexpand Job_Name |eval Job_Name="aaa.bbb.ccc.".Job_Name.".dddddd.ccccc" | table Job_Name  ]   &amp;lt;/query&amp;gt;
           &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
           &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
         &amp;lt;/search&amp;gt;
         &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
         &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
         &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&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;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 14:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417182#M27457</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-12-03T14:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417183#M27458</link>
      <description>&lt;P&gt;Awesomw @kamlesh_vaghela.  This is what I am looking for.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:15:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417183#M27458</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2018-12-03T18:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417184#M27459</link>
      <description>&lt;P&gt;Thank you for the immediate response @whrg.  This query limiting the numbers to 3. I need it depends on the user input.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 18:17:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417184#M27459</guid>
      <dc:creator>Kwip</dc:creator>
      <dc:date>2018-12-03T18:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417185#M27460</link>
      <description>&lt;P&gt;Glad to help you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;STRONG&gt;Happy Splunking&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 05:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/417185#M27460</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-12-04T05:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/556667#M38698</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;I have "Text Panel" on dashboard, which is created to filter results with "file name". So if I give single file name it is working fine. But I am looking for multiple inputs like "filename01.txt , filename02.pdf", then it should give the table output on dashboard.&lt;/P&gt;&lt;P&gt;Please help how can I configure or write a code for "Text Panel" to get correct results.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Raghu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 11:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/556667#M38698</guid>
      <dc:creator>naidunath</dc:creator>
      <dc:date>2021-06-22T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read comma separated inputs from a single text input box in a form?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/556669#M38699</link>
      <description>&lt;P&gt;Please see the screen shot "File Name", need the help on that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naidunath_0-1624362947376.png" style="width: 746px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14739iE71A9E4DF7B53270/image-dimensions/746x64?v=v2" width="746" height="64" role="button" title="naidunath_0-1624362947376.png" alt="naidunath_0-1624362947376.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 11:57:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-read-comma-separated-inputs-from-a-single-text-input/m-p/556669#M38699</guid>
      <dc:creator>naidunath</dc:creator>
      <dc:date>2021-06-22T11:57:18Z</dc:date>
    </item>
  </channel>
</rss>

