<?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 create a text box using condition in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509842#M33985</link>
    <description>&lt;P&gt;Based on the original ask, my intent was to show you how to use the SPL to perform validations you need. I would expect you to incorporate any further validations as per your needs. I am not sure why you want to treat a URL without https and http as valid URL. Nevertheless take advantage of SPL and add as many validations you need!&lt;/P&gt;&lt;P&gt;Do upvote the answers that helped!&lt;/P&gt;</description>
    <pubDate>Sat, 18 Jul 2020 15:27:56 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-07-18T15:27:56Z</dc:date>
    <item>
      <title>How to create a text box using condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509589#M33951</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;How to create the text box with the condition for Accepting user input only if the URL starts from &lt;A href="https://somthinglike.com" target="_blank" rel="noopener"&gt;https://somthinglike.com&lt;/A&gt;.&lt;BR /&gt;if any user enters &lt;A href="http://www.facebook.com" target="_blank" rel="noopener"&gt;www.facebook.com&lt;/A&gt; it ll not consider or save to the text box because https is missing.&lt;BR /&gt;Need to implement&lt;BR /&gt;1.URL condition.&lt;BR /&gt;2. Only 5 URL allow&lt;BR /&gt;Below is the screenshort&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="textbox.JPG" style="width: 671px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9728iFFC4DBDD8D151974/image-size/large?v=v2&amp;amp;px=999" role="button" title="textbox.JPG" alt="textbox.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509589#M33951</guid>
      <dc:creator>hrs2019</dc:creator>
      <dc:date>2020-07-16T20:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text box using condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509812#M33979</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/32069"&gt;@hrs2019&lt;/a&gt;&amp;nbsp;you can use an independent search to pass the URLs from text box to SPL and process to validate whether it matches your Upto 5 URL criteria and all URL beginning with https criteria.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-18 at 3.35.45 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9761i668F582C353E0AEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-18 at 3.35.45 AM.png" alt="Screen Shot 2020-07-18 at 3.35.45 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-18 at 3.36.03 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9762i22808A44F9805A94/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-18 at 3.36.03 AM.png" alt="Screen Shot 2020-07-18 at 3.36.03 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-18 at 3.36.38 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9763iC916EDE3346BF6B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-18 at 3.36.38 AM.png" alt="Screen Shot 2020-07-18 at 3.36.38 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-18 at 3.36.50 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9764i4890D57EB3C66062/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-18 at 3.36.50 AM.png" alt="Screen Shot 2020-07-18 at 3.36.50 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is a run anywhere sample dashboard for above example. Please try out and confirm!&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Text Box Validation&amp;lt;/label&amp;gt;
  &amp;lt;search&amp;gt;
    &amp;lt;query&amp;gt;| makeresults
      | eval url="$url$"
      | eval url_count=split(trim(url),",")
      | rex field=url "(?&amp;amp;lt;url_type&amp;amp;gt;(https|http))" max_match=0
      | eval boolValidationURLCount=case(mvcount(url_count)&amp;amp;lt;=5,"true",true(),"false")
      | eval boolValidationURLCondition=case(url_type="https" AND url_type!="http","true",true(),"false")&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;condition match="$result.boolValidationURLCount$==&amp;amp;quot;true&amp;amp;quot; AND $result.boolValidationURLCondition$==&amp;amp;quot;true&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="tokValidURLs"&amp;gt;$result.url$&amp;lt;/set&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="$result.boolValidationURLCount$==&amp;amp;quot;false&amp;amp;quot; AND $result.boolValidationURLCondition$==&amp;amp;quot;false&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="tokValidationError"&amp;gt;Only upto 5 URLs allowed. URL must start with https&amp;lt;/set&amp;gt;
        &amp;lt;unset token="tokValidURLs"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="$result.boolValidationURLCount$==&amp;amp;quot;false&amp;amp;quot; AND $result.boolValidationURLCondition$==&amp;amp;quot;true&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="tokValidationError"&amp;gt;Only upto 5 URLs allowed.&amp;lt;/set&amp;gt;
        &amp;lt;unset token="tokValidURLs"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition match="$result.boolValidationURLCount$==&amp;amp;quot;true&amp;amp;quot; AND $result.boolValidationURLCondition$==&amp;amp;quot;false&amp;amp;quot;"&amp;gt;
        &amp;lt;set token="tokValidationError"&amp;gt;URLs must start with https&amp;lt;/set&amp;gt;
        &amp;lt;unset token="tokValidURLs"&amp;gt;&amp;lt;/unset&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input id="splunk_input_text_url" type="text" token="url" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Enter Upto 5 URLs (https ONLY)&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;https://www.facebook.com,https://www.gmail.com,https://www.amazon.com;https://www.splunk.com,https://yahoo.com,https://se.ccp.com&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html rejects="$tokValidURLs$"&amp;gt;
        &amp;lt;style&amp;gt;
          #splunk_input_text_url{
            width: 1220px !important;
          }
        &amp;lt;/style&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;b style="color:red"&amp;gt;$tokValidationError$.&amp;lt;/b&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div&amp;gt;
          Please validate input &amp;lt;b style="color:red"&amp;gt;$url$&amp;lt;/b&amp;gt;!!!
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table depends="$tokValidURLs$"&amp;gt;
        &amp;lt;title&amp;gt;Table with valid URLs&amp;lt;/title&amp;gt;
        &amp;lt;search depends="$tokValidURLs$"&amp;gt;
          &amp;lt;query&amp;gt;| makeresults 
| fields - _time 
| eval URL="$tokValidURLs$" 
| makemv URL delim="," 
| mvexpand URL 
| rex field=URL "(?&amp;amp;lt;URL_Type&amp;amp;gt;(https|http))"
| table URL, URL_Type&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;true&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;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509812#M33979</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-17T22:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text box using condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509832#M33984</link>
      <description>&lt;P&gt;Hi, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;Thank You so much for your solution.&lt;BR /&gt;Actually I am getting one issue that needs your help.&lt;BR /&gt;While entering the URL 1 it shows URL1 in the panel which is correct, but while entering URL 2 it shows only Url 2, &lt;STRONG&gt;ideally it has to show both the URLs.&lt;/STRONG&gt;&lt;BR /&gt;This is applicable for 5 URLs as we have set the condition.&lt;BR /&gt;If any URL is missing &lt;STRONG&gt;https//:&lt;/STRONG&gt; it ll not allow and ll not display in the panel.&lt;BR /&gt;Can you please help me to fix this. I have added the screenshot for more info.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="URL1.JPG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9765i9AADD1D6A1E5A577/image-size/large?v=v2&amp;amp;px=999" role="button" title="URL1.JPG" alt="URL1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 13:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509832#M33984</guid>
      <dc:creator>hrs2019</dc:creator>
      <dc:date>2020-07-18T13:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a text box using condition</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509842#M33985</link>
      <description>&lt;P&gt;Based on the original ask, my intent was to show you how to use the SPL to perform validations you need. I would expect you to incorporate any further validations as per your needs. I am not sure why you want to treat a URL without https and http as valid URL. Nevertheless take advantage of SPL and add as many validations you need!&lt;/P&gt;&lt;P&gt;Do upvote the answers that helped!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Jul 2020 15:27:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/m-p/509842#M33985</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-18T15:27:56Z</dc:date>
    </item>
  </channel>
</rss>

