<?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 edit Macro from a search dashboard checklist? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424608#M27966</link>
    <description>&lt;P&gt;Hey Knielsen,&lt;/P&gt;

&lt;P&gt;Thank you for your prompt reply.. &lt;BR /&gt;
This is a bit different to what I am trying to achieve. Reason I am using Macros rather than Token, is because the parameter it stores I would like to use it against several dashboards instead of just the one local dashboard.&lt;BR /&gt;
The Macro I would like to amend is stored in Settings &amp;gt; Advanced Search &amp;gt; Macros&lt;/P&gt;

&lt;P&gt;Thanks again.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Apr 2019 09:47:32 GMT</pubDate>
    <dc:creator>kamrankayani</dc:creator>
    <dc:date>2019-04-24T09:47:32Z</dc:date>
    <item>
      <title>How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424606#M27964</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;My aim is to have a checklist in a dashboard and according to what is selected, the content or description of a specific Macro is amended.&lt;/P&gt;

&lt;P&gt;For example.&lt;/P&gt;

&lt;H2&gt;Checklist1&lt;/H2&gt;

&lt;P&gt;Tom ✔&lt;BR /&gt;
Jerry&lt;BR /&gt;
Peter ✔&lt;BR /&gt;
Pan&lt;/P&gt;

&lt;P&gt;Macro1 = "Tom, Peter"&lt;/P&gt;

&lt;P&gt;Is there a way in doing this?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 08:58:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424606#M27964</guid>
      <dc:creator>kamrankayani</dc:creator>
      <dc:date>2019-04-24T08:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424607#M27965</link>
      <description>&lt;P&gt;Well, you can't use "," as part of a macro name. So if you want to use a delimiter, "_" would be my choice, eg something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="checkbox" token="Macro1"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Tom"&amp;gt;Tom&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Jerry"&amp;gt;Jerry&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Peter"&amp;gt;Peter&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Pan"&amp;gt;Pan&amp;lt;/choice&amp;gt;
      &amp;lt;delimiter&amp;gt;_&amp;lt;/delimiter&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then simply use it in your query like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;query&amp;gt;index=foo ... | `$Macro1$` ... &amp;lt;/query&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So "Tom, Peter" won't work, but "Tom_Peter" does.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 09:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424607#M27965</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2019-04-24T09:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424608#M27966</link>
      <description>&lt;P&gt;Hey Knielsen,&lt;/P&gt;

&lt;P&gt;Thank you for your prompt reply.. &lt;BR /&gt;
This is a bit different to what I am trying to achieve. Reason I am using Macros rather than Token, is because the parameter it stores I would like to use it against several dashboards instead of just the one local dashboard.&lt;BR /&gt;
The Macro I would like to amend is stored in Settings &amp;gt; Advanced Search &amp;gt; Macros&lt;/P&gt;

&lt;P&gt;Thanks again.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 09:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424608#M27966</guid>
      <dc:creator>kamrankayani</dc:creator>
      <dc:date>2019-04-24T09:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424609#M27967</link>
      <description>&lt;P&gt;Yeah, I misunderstood I guess.&lt;/P&gt;

&lt;P&gt;You want to change existing macros? It is possible (but not easy) to use the REST API for that, but there is no direct way of doing that without some external scripting AFAIK.&lt;/P&gt;

&lt;P&gt;Search for topics on REST API and macros for a start, or wait for someone who can give better advise. I just played around with it for a little, but that's really nothing I can help directly with. &lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:21:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424609#M27967</guid>
      <dc:creator>knielsen</dc:creator>
      <dc:date>2019-04-24T11:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424610#M27968</link>
      <description>&lt;P&gt;No worries, thanks for your help again!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 11:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424610#M27968</guid>
      <dc:creator>kamrankayani</dc:creator>
      <dc:date>2019-04-24T11:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit Macro from a search dashboard checklist?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424611#M27969</link>
      <description>&lt;P&gt;Hi @knielsen,&lt;/P&gt;

&lt;P&gt;You need to do rest call (&lt;STRONG&gt;/servicesNS/admin//configs/conf-macros/&lt;/STRONG&gt;) to macro conf file to update macro definition. The following two ways you can try.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;With Python&lt;/STRONG&gt;&lt;BR /&gt;
- Write custom command (commands.conf, bin/python-file)&lt;BR /&gt;
- Use &lt;STRONG&gt;splunk.rest.SimpleRequest&lt;/STRONG&gt; to call on &lt;STRONG&gt;/servicesNS/admin//configs/conf-macros/&lt;/STRONG&gt; with &lt;STRONG&gt;POST&lt;/STRONG&gt; method to update value -  &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/RESTREF/RESTconf#configs.2Fconf-.7Bfile.7D.2F.7Bname.7D"&gt;Reference&lt;/A&gt; &lt;BR /&gt;
- Call custom command from a search and pass the selected values as argument to custom command.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;With Javascript&lt;/STRONG&gt;&lt;BR /&gt;
Call given rest call (&lt;STRONG&gt;/servicesNS/admin//configs/conf-macros/&lt;/STRONG&gt;) from javascript as well. &lt;A href="http://dev.splunk.com/view/javascript-sdk/SP-CAAAEC9"&gt;Reference&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 12:47:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-edit-Macro-from-a-search-dashboard-checklist/m-p/424611#M27969</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-04-24T12:47:18Z</dc:date>
    </item>
  </channel>
</rss>

