<?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 Need help with Regex in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/568669#M46709</link>
    <description>&lt;P&gt;I have a regex in my dashboard that performs the validation whether the input value in the field is Numeric or Not.&amp;nbsp; The code/regex works perfectly well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I&amp;nbsp; need some help in modifying the particular regex so that it should also check if the input field contains any special character such as " &amp;lt;double quote&amp;gt; or &amp;lt;space&amp;gt; at the starting or ending or middle of the string (Basically Padding, Spacing or quotes), That would really&amp;nbsp; help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The&amp;nbsp; regex that I have which only checks numeric is as follows. It is under the if(match(value ...section&amp;nbsp; , Highlighted in&lt;STRONG&gt; Bold&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;=================================================&lt;BR /&gt;&amp;lt;input type="text" token="selText"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Enter Only Digits&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;change&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, &amp;amp;quot;^[0-9]+$&amp;amp;quot;), &amp;amp;quot;Numeric&amp;amp;quot;, &amp;amp;quot;Not Numeric&amp;amp;quot;)&amp;lt;/eval&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;================================================================================&lt;/P&gt;</description>
    <pubDate>Tue, 28 Sep 2021 08:05:48 GMT</pubDate>
    <dc:creator>zacksoft_wf</dc:creator>
    <dc:date>2021-09-28T08:05:48Z</dc:date>
    <item>
      <title>Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/568669#M46709</link>
      <description>&lt;P&gt;I have a regex in my dashboard that performs the validation whether the input value in the field is Numeric or Not.&amp;nbsp; The code/regex works perfectly well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I&amp;nbsp; need some help in modifying the particular regex so that it should also check if the input field contains any special character such as " &amp;lt;double quote&amp;gt; or &amp;lt;space&amp;gt; at the starting or ending or middle of the string (Basically Padding, Spacing or quotes), That would really&amp;nbsp; help.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The&amp;nbsp; regex that I have which only checks numeric is as follows. It is under the if(match(value ...section&amp;nbsp; , Highlighted in&lt;STRONG&gt; Bold&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;=================================================&lt;BR /&gt;&amp;lt;input type="text" token="selText"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Enter Only Digits&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;change&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, &amp;amp;quot;^[0-9]+$&amp;amp;quot;), &amp;amp;quot;Numeric&amp;amp;quot;, &amp;amp;quot;Not Numeric&amp;amp;quot;)&amp;lt;/eval&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;================================================================================&lt;/P&gt;</description>
      <pubDate>Tue, 28 Sep 2021 08:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/568669#M46709</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-09-28T08:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/568700#M46713</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, &amp;amp;quot;^[0-9]+$&amp;amp;quot;), &amp;amp;quot;Numeric&amp;amp;quot;, if(match(value, &amp;amp;quot;[[:punct:] ]&amp;amp;quot;), &amp;amp;quot;Punctuation or space&amp;amp;quot;, &amp;amp;quot;Not Numeric&amp;amp;quot;))&amp;lt;/eval&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Sep 2021 11:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/568700#M46713</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-28T11:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569070#M46733</link>
      <description>&lt;P&gt;I tried to test it , whether the input value in the text box has " &amp;lt;quotation Mark&amp;gt; or space padded anywhere in the beginning or end , But it's not working.&lt;BR /&gt;It's rather giving me "malformed expression in eval".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;input type="text" token="selText"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Don't enter any Splunk Un-escapable characters&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;change&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, &amp;amp;quot;[[:punct:] ]&amp;amp;quot;), &amp;amp;quot;Punctuation or space&amp;amp;quot;, &amp;amp;quot;Not Punctuation or space&amp;amp;quot;&amp;lt;/eval&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;/P&gt;&lt;P&gt;==========================&lt;BR /&gt;&lt;BR /&gt;When I tried to input this&amp;nbsp;&lt;STRONG&gt;22"455"&lt;BR /&gt;&lt;/STRONG&gt;Instead of getting the validation command&amp;nbsp; , I see this "&lt;STRONG&gt;&lt;SPAN&gt;Error in 'eval' command: The expression is malformed.&lt;/SPAN&gt;"&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 08:31:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569070#M46733</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-09-30T08:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569075#M46734</link>
      <description>&lt;P&gt;It looks like classes aren't recognised here try it this way&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, &amp;amp;quot;[^a-zA-Z0-9]&amp;amp;quot;), &amp;amp;quot;Punctuation or space&amp;amp;quot;, &amp;amp;quot;Not Punctuation or space&amp;amp;quot;&amp;lt;/eval&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Sep 2021 08:44:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569075#M46734</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-30T08:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569109#M46735</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, It's&amp;nbsp; almost perfect.&amp;nbsp; Just a minor issue.&amp;nbsp;&lt;BR /&gt;Issue : When I input any string or number with padded spaces in front or back it gives that warning, also it gives warning when I enter slash (/) , which is just perfect. The problem occurs, when I input a quotation sign, example NewYork"&amp;nbsp; &amp;nbsp; or&amp;nbsp; "New"York , then it throws error and says "Unbalanced quotes". Also, is there a way we can only validate if the space is in the beginning or end ? currently if the space is between strings it's showing validation message too. example: New&amp;lt;space&amp;gt;Yoork&lt;BR /&gt;Thank you so much for your help.&amp;nbsp; I'm pasting the entire dashboard code snippet for your reference.&lt;BR /&gt;&lt;BR /&gt;===============================================================&lt;BR /&gt;&amp;lt;form&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;TextBox Validation&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;fieldset submitButton="false"&amp;gt;&lt;BR /&gt;&amp;lt;input type="text" token="selText"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Enter your Input (Do not add splunk special charachters that cannot be escaped)&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;change&amp;gt;&lt;BR /&gt;&amp;lt;eval token="validationResult"&amp;gt;if(match(value, "[^a-zA-Z0-9]"), "Punctuation or space", "Not Punctuation or space"&amp;lt;/eval&amp;gt;&lt;BR /&gt;&amp;lt;/change&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;&amp;lt;row&amp;gt;&lt;BR /&gt;&amp;lt;panel&amp;gt;&lt;BR /&gt;&amp;lt;table&amp;gt;&lt;BR /&gt;&amp;lt;search&amp;gt;&lt;BR /&gt;&amp;lt;query&amp;gt;| makeresults&lt;BR /&gt;| eval Text="$selText$ is $validationResult$"&lt;BR /&gt;| table Text&amp;lt;/query&amp;gt;&lt;BR /&gt;&amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;&lt;BR /&gt;&amp;lt;/search&amp;gt;&lt;BR /&gt;&amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;&lt;BR /&gt;&amp;lt;/table&amp;gt;&lt;BR /&gt;&amp;lt;/panel&amp;gt;&lt;BR /&gt;&amp;lt;/row&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;===============================================================&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 11:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569109#M46735</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-09-30T11:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569127#M46736</link>
      <description>&lt;P&gt;You could use a token modifier&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval Text="$selText|s$ is $validationResult$"&lt;/LI-CODE&gt;&lt;P&gt;You could include space as a valid character and then trim the value before using it&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569127#M46736</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-30T12:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569132#M46737</link>
      <description>&lt;P&gt;any suggestion about identifying " &amp;lt;double quotes&amp;gt; using regex ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:37:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569132#M46737</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-09-30T12:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569133#M46738</link>
      <description>&lt;P&gt;Which version of splunk are you using because I am not seeing that issue?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569133#M46738</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-09-30T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Regex</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569134#M46739</link>
      <description>&lt;P&gt;Version: 8.1.4 When I am inputting the string say,&amp;nbsp;gfgfgf"hh.&lt;BR /&gt;It says 'Unbalanced Quotes' instead of the custom message from the else statement.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Sep 2021 12:51:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-with-Regex/m-p/569134#M46739</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-09-30T12:51:00Z</dc:date>
    </item>
  </channel>
</rss>

