<?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 Custom Alert Action UI - dynamic drop down list in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287111#M5296</link>
    <description>&lt;P&gt;In my custom alert action UI, I would like to include an HTML select (drop down list) with values that are retrieved from an external REST call.  The documentation does state that only HTML fragments are recommended - and my testing shows that javascript code is stripped out by Splunk.&lt;/P&gt;

&lt;P&gt;Is there any way to display dynamic content in the custom alert action UI?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2016 14:29:52 GMT</pubDate>
    <dc:creator>cwb2</dc:creator>
    <dc:date>2016-07-29T14:29:52Z</dc:date>
    <item>
      <title>Custom Alert Action UI - dynamic drop down list</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287111#M5296</link>
      <description>&lt;P&gt;In my custom alert action UI, I would like to include an HTML select (drop down list) with values that are retrieved from an external REST call.  The documentation does state that only HTML fragments are recommended - and my testing shows that javascript code is stripped out by Splunk.&lt;/P&gt;

&lt;P&gt;Is there any way to display dynamic content in the custom alert action UI?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 14:29:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287111#M5296</guid>
      <dc:creator>cwb2</dc:creator>
      <dc:date>2016-07-29T14:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action UI - dynamic drop down list</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287112#M5297</link>
      <description>&lt;P&gt;This is extremely old, but I thought I would give an answer anyway. Please follow this doc to find your answer: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/AdvancedDev/CustomAlertUI#Dynamic_input_controls" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/AdvancedDev/CustomAlertUI#Dynamic_input_controls&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:10:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287112#M5297</guid>
      <dc:creator>zshainsky</dc:creator>
      <dc:date>2020-09-29T13:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action UI - dynamic drop down list</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287113#M5298</link>
      <description>&lt;P&gt;This doesn't seem to work properly. I added custom drilldown(splunk-search-dropdown) to my html, it executes the search query and gives me values in dropdown. But, when I select and save the configuration, it's not reflected in conf file. It never saves the selected dropdown value.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;div class="control-group"&amp;gt;
    &amp;lt;label class="control-label"&amp;gt;Custom Dropdown&amp;lt;/label&amp;gt;
    &amp;lt;div class="controls"&amp;gt;
        &amp;lt;splunk-search-dropdown name="action.[app_name].param.[param_name]"
                search="[search query]"
                value-field="[value_field]" label-field="[label_field]"&amp;gt;
        &amp;lt;/splunk-search-dropdown&amp;gt;
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, if I add 'splunk-search-dropdown' inside 'splunk-control-group' , the dropdown never shows up.&lt;BR /&gt;
I have already added param_name in alert_actions.conf&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/287113#M5298</guid>
      <dc:creator>juiawate11</dc:creator>
      <dc:date>2020-09-29T13:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Alert Action UI - dynamic drop down list</title>
      <link>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/557734#M10616</link>
      <description>&lt;P&gt;Excuse my super late reply. Below may help those who arrive here after me.&lt;BR /&gt;&lt;BR /&gt;Be careful to check that your html is referencing your &lt;STRONG&gt;stanza name&lt;/STRONG&gt; - not your app name.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;splunk-search-dropdown name="action.[&lt;STRONG&gt;stanza_name&lt;/STRONG&gt;].param.[param_name]"...&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is how to extend the "logger_app" example &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/AdvancedDev/ModAlertsBasicExample" target="_self"&gt;in docs&lt;/A&gt;&amp;nbsp;to add a dropdown. User's choice is sent to script.&lt;BR /&gt;&lt;BR /&gt;logger.html&lt;/P&gt;&lt;PRE&gt;&amp;lt;form class="form-horizontal form-complex"&amp;gt;&lt;BR /&gt;&amp;lt;p&amp;gt;Write log entries for this action.&amp;lt;/p&amp;gt;&lt;BR /&gt;&amp;lt;splunk-search-dropdown name="action&lt;STRONG&gt;.logger.&lt;/STRONG&gt;param&lt;STRONG&gt;.&lt;/STRONG&gt;mychoice1"&lt;BR /&gt;search=" | inputlookup alert_action_dropdown1.csv | stats c by foo1"&lt;BR /&gt;value-field="foo1" label-field="foo1"/&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;/PRE&gt;&lt;P&gt;alert_actions.conf&lt;/P&gt;&lt;PRE&gt;[logger]&lt;BR /&gt;is_custom = 1&lt;BR /&gt;disabled = 0&lt;BR /&gt;label = Log alert action&lt;BR /&gt;description = Custom action for logging fired alerts&lt;BR /&gt;icon_path = logger_logo.png&lt;BR /&gt;param.mychoice0=This param is hardcoded. Look, I can use a token: $result.host$&lt;BR /&gt;#param.mychoice1=This param comes in from your stanza in savedsearches.conf.&lt;BR /&gt;#savedsearches.conf: action.logger.param.mychoice1=User picks from the UI. See logger.html&lt;/PRE&gt;&lt;P&gt;Output in test_modalert.log&amp;nbsp; then looks like:&lt;/P&gt;&lt;PRE&gt;...&amp;lt;/search_name&amp;gt;&lt;BR /&gt;&amp;lt;configuration&amp;gt;&lt;BR /&gt; &amp;lt;stanza name="test_alert_action_logger_with_added_dropdown1"&amp;gt;&lt;BR /&gt;  &amp;lt;param name="mychoice0"&amp;gt;This param is hardcoded. Look, I can use a token: &amp;lt;/param&amp;gt;&lt;BR /&gt;  &amp;lt;param name="mychoice1"&amp;gt;splunk2&amp;lt;/param&amp;gt;&lt;BR /&gt; &amp;lt;/stanza&amp;gt;&lt;BR /&gt;&amp;lt;/configuration&amp;gt;&lt;BR /&gt;&amp;lt;result&amp;gt;...&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 02:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Custom-Alert-Action-UI-dynamic-drop-down-list/m-p/557734#M10616</guid>
      <dc:creator>shandr</dc:creator>
      <dc:date>2021-06-30T02:31:37Z</dc:date>
    </item>
  </channel>
</rss>

