<?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: Custom Alert Action ui validation for empty values in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332997#M10989</link>
    <description>&lt;P&gt;That is working! Thanks very much.&lt;/P&gt;

&lt;P&gt;Am I understanding this correctly, to check for a null/empty field you need to check when the alert is saved i.e. 'action.myaction' not on the field itself 'action.myaction.param.title'?&lt;/P&gt;</description>
    <pubDate>Tue, 12 Dec 2017 23:38:00 GMT</pubDate>
    <dc:creator>gavins_k1</dc:creator>
    <dc:date>2017-12-12T23:38:00Z</dc:date>
    <item>
      <title>Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332991#M10983</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;I am trying to create a custom alert action, trying to add any validation to the ui fields doesnt work. &lt;BR /&gt;
I am trying to test to see if a field has been left empty, my restmap.conf contains:&lt;BR /&gt;
&lt;CODE&gt;[validation:savedsearch]&lt;BR /&gt;
action.myaction.param.title = validate( len(trim('action.myaction.param.title')) &amp;gt; 0), "Title cannot be empty")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I have also tried&lt;BR /&gt;
&lt;CODE&gt;action.myaction.param.title = validate( isnotnull('action.myaction.param.title'), "Title cannot be empty")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and&lt;BR /&gt;
&lt;CODE&gt;action.myaction.param.title = validate( match('action.myaction.param.title',"^\w+"), "Title cannot be empty")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and a bunch of others that I thought would have been false for an empty ui field, and therefore trigger the error message. The alert was able to be saved regardless if the ui field had any text in it or not.&lt;/P&gt;

&lt;P&gt;Does anyone have any ideas of how to check for an empty ui field in an a custom alert action?&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 08:54:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332991#M10983</guid>
      <dc:creator>gavins_k1</dc:creator>
      <dc:date>2017-12-11T08:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332992#M10984</link>
      <description>&lt;P&gt;After changing restmap.conf, have you restarted splunk ?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 11:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332992#M10984</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-11T11:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332993#M10985</link>
      <description>&lt;P&gt;Your configurations for validation of parameter on alert ui is correct.  You are looking for empty value right! &lt;/P&gt;

&lt;P&gt;Did you try with isnull method?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 12:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332993#M10985</guid>
      <dc:creator>hardikJsheth</dc:creator>
      <dc:date>2017-12-11T12:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332994#M10986</link>
      <description>&lt;P&gt;yes, each time restmap.conf is changed, I am restarting splunk&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 21:04:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332994#M10986</guid>
      <dc:creator>gavins_k1</dc:creator>
      <dc:date>2017-12-11T21:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332995#M10987</link>
      <description>&lt;P&gt;i tried using isnull as well...&lt;BR /&gt;
the only validations i could get doing anything at all:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action.myaction.param.title = validate( 1!=1 , 'just give me an error')
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which always gave an error&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;action.myaction.param.title = validate( 'action.myaction.param.title' == "1" , "title is not 1")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which would give an error when i made the title box 1&lt;/P&gt;

&lt;P&gt;it felt like if i used a eval function, the validation doesnt work. with this, i also thought the paramater name might be reserved, so i tried everything again using "..mytitle" instead of "..title" with no luck.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 21:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332995#M10987</guid>
      <dc:creator>gavins_k1</dc:creator>
      <dc:date>2017-12-11T21:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332996#M10988</link>
      <description>&lt;P&gt;Can you please try below restmap.conf ? In below example I assume that your alert_actions.conf contains stanza with heading &lt;CODE&gt;[myaction]&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[validation:savedsearch]
action.myaction = case('action.myaction' != "1", null(), 'action.myaction.param.title' == "action.myaction.param.title" OR 'action.myaction.param.title' == "", "Title cannot be empty",  1==1, null())
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Dec 2017 14:34:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332996#M10988</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-12T14:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332997#M10989</link>
      <description>&lt;P&gt;That is working! Thanks very much.&lt;/P&gt;

&lt;P&gt;Am I understanding this correctly, to check for a null/empty field you need to check when the alert is saved i.e. 'action.myaction' not on the field itself 'action.myaction.param.title'?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 23:38:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332997#M10989</guid>
      <dc:creator>gavins_k1</dc:creator>
      <dc:date>2017-12-12T23:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332998#M10990</link>
      <description>&lt;P&gt;Yes you are correct&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 23:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332998#M10990</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2017-12-12T23:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332999#M10991</link>
      <description>&lt;P&gt;How should I validate multiple parameter values using above logic? I wrote something like below in restmap.conf but its not working and giving error even if the data is entered.&lt;/P&gt;

&lt;P&gt;[validation:savedsearch]&lt;/P&gt;

&lt;H1&gt;Require parameters to be set if webhook action is enabled&lt;/H1&gt;

&lt;P&gt;action.snow_webhook = case('action.snow_webhook' != "1", null(), 'action.snow_webhook.param.url' == "action.snow_webhook.param.url" OR 'action.snow_webhook.param.url' == "", "No Webhook URL specified", 1==1, null())&lt;BR /&gt;
action.snow_webhook = case('action.snow_webhook' != "1", null(), 'action.snow_webhook.param.assignment_group' == "action.snow_webhook.param.assignment_group" OR 'action.snow_webhook.param.assignment_group' == "", "Assignment Group cannot be empty", 1==1, null())&lt;BR /&gt;
action.snow_webhook = case('action.snow_webhook' != "1", null(), 'action.snow_webhook.param.service_offering' == "action.snow_webhook.param.service_offering" OR 'action.snow_webhook.param.service_offering' == "", "Service Offering cannot be empty", 1==1, null())&lt;BR /&gt;
action.snow_webhook = case('action.snow_webhook' != "1", null(), 'action.snow_webhook.param.description' == "action.snow_webhook.param.description" OR 'action.snow_webhook.param.description' == "", "Description cannot be empty", 1==1, null())&lt;BR /&gt;
action.snow_webhook.param.url = validate(match('action.snow_webhook.param.url', "^https?://[^\s]+$"), "Webhook URL is invalid")&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/332999#M10991</guid>
      <dc:creator>santosh_sshanbh</dc:creator>
      <dc:date>2020-09-29T23:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/333000#M10992</link>
      <description>&lt;P&gt;@santosh_sshanbhag please post new question &lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:31:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/333000#M10992</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-21T13:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action ui validation for empty values</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/333001#M10993</link>
      <description>&lt;P&gt;Ok, posted a new thread as &lt;/P&gt;

&lt;P&gt;'How to add validation for multiple parameters in custom alert action'&lt;/P&gt;

&lt;P&gt;Please help if you are aware of the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:45:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-ui-validation-for-empty-values/m-p/333001#M10993</guid>
      <dc:creator>santosh_sshanbh</dc:creator>
      <dc:date>2019-02-21T13:45:53Z</dc:date>
    </item>
  </channel>
</rss>

