<?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 can I escape dollar-signs to use &amp;quot;map&amp;quot; or &amp;quot;sendemail&amp;quot; inside of a macro or workflow? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698148#M237108</link>
    <description>&lt;P&gt;I'm having the same issue, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;. Let me know if you figured it out (you usually do). &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2024 23:34:36 GMT</pubDate>
    <dc:creator>ejwade</dc:creator>
    <dc:date>2024-09-03T23:34:36Z</dc:date>
    <item>
      <title>How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450050#M127434</link>
      <description>&lt;P&gt;All 4 things use the &lt;CODE&gt;$argument$&lt;/CODE&gt; syntax.  I am trying to use &lt;CODE&gt;sendemail&lt;/CODE&gt; inside of a &lt;CODE&gt;macro&lt;/CODE&gt; and have tried &lt;CODE&gt;\$search\$&lt;/CODE&gt;, &lt;CODE&gt;$$search$$&lt;/CODE&gt;, and &lt;CODE&gt;$$$search$$$&lt;/CODE&gt; but none works.  Is it even possible?&lt;/P&gt;

&lt;P&gt;My macro is this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sendemail
sendresults=true
inline=true
graceful=true
to=whatever@gmail.com
subject="subject"
message="This report alert was generated by search $name$ in $app$ Splunk with this search string: $search$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the &lt;CODE&gt;$name$&lt;/CODE&gt;, &lt;CODE&gt;$app$&lt;/CODE&gt;,  and &lt;CODE&gt;$search$&lt;/CODE&gt; are being eaten.&lt;/P&gt;

&lt;P&gt;See dox here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 01:16:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450050#M127434</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T01:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450051#M127435</link>
      <description>&lt;P&gt;This is also a problem for &lt;CODE&gt;ldapsearch&lt;/CODE&gt; command as documented (and solved!) here: &lt;A href="https://answers.splunk.com/answers/223246/workflow-action-contains-other-variables-how-do-i.html"&gt;https://answers.splunk.com/answers/223246/workflow-action-contains-other-variables-how-do-i.html&lt;/A&gt;&lt;BR /&gt;
Unfortunately, the solution was to use a macro!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 01:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450051#M127435</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T01:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450052#M127436</link>
      <description>&lt;P&gt;Wait a minute.  I think I have the answer.  As long as the variables for the "other" thing do not match the names of the arguments of my macro, my macro should ignore them (I think)!  Testing now...&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 01:53:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450052#M127436</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T01:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450053#M127437</link>
      <description>&lt;P&gt;Did not work.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 02:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450053#M127437</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T02:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450054#M127438</link>
      <description>&lt;P&gt;@woodcock I'm not clear on what you mean. I have a simple search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_access user=efavreau |  stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Created a macro:&lt;BR /&gt;
name: &lt;CODE&gt;testsendemail(3)&lt;/CODE&gt;&lt;BR /&gt;
definition: &lt;CODE&gt;sendemail sendresults=true inline=true graceful=true to=me@me.com subject="subject" message="This report alert was generated by search $name$ in $app$ Splunk with this search string: $search$ "&lt;/CODE&gt;&lt;BR /&gt;
args: &lt;CODE&gt;name, app, search&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Put it all together:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_access user=efavreau 
|  stats count
| `testsendemail(mytest,FOOAPP,"index=_internal sourcetype=splunkd_access user=efavreau |  stats count")`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ran it in the GUI and that worked for me in v6.6.6. So then I scheduled the report on a cron * * * * * , and that worked too.&lt;BR /&gt;
Am I missing something?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 12:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450054#M127438</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-03-20T12:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450055#M127439</link>
      <description>&lt;P&gt;Let me clarify.  I get the email, but the 3 variables do not get dereferenced; they get dropped altogether.  so the &lt;CODE&gt;message&lt;/CODE&gt; should be &lt;CODE&gt;This report alert was generated by search This Is The Search Name in AppName Splunk with this search string: index=foo sourcetype=bar ...&lt;/CODE&gt; but instead I get &lt;CODE&gt;This report alert was generated by search in Splunk with this search string:&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 14:13:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450055#M127439</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T14:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450056#M127440</link>
      <description>&lt;P&gt;Isn't the "!" the correct escape character here? Got nothing to test right now..&lt;BR /&gt;
I think it's $!variable$&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 14:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450056#M127440</guid>
      <dc:creator>skalliger</dc:creator>
      <dc:date>2019-03-20T14:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450057#M127441</link>
      <description>&lt;P&gt;Let me restate my problem.  There are multiple things in Splunk that use the &lt;CODE&gt;$argument$&lt;/CODE&gt; syntax.  The question is: how do I get 2 of those things to work together when they both think that &lt;CODE&gt;$argument$&lt;/CODE&gt; is for him.  In this case, the 2 things are &lt;CODE&gt;macro&lt;/CODE&gt; and &lt;CODE&gt;sendemail&lt;/CODE&gt;.  How do I get &lt;CODE&gt;macro&lt;/CODE&gt; not to mess up the arguments that are intended for &lt;CODE&gt;sendemail&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 15:50:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450057#M127441</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-20T15:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450058#M127442</link>
      <description>&lt;P&gt;@woodcock  It's difficult for me to test. It's sparked a lot of conversation over here. I see someone else can't test it. Do you think you could work this into a run anywhere example of where you are so far? Then people could test in parallel. At a minimum, we could comment on what we tried and what didn't work. At the most, we'd find the solution. Thoughts?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2019 18:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/450058#M127442</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2019-03-21T18:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698148#M237108</link>
      <description>&lt;P&gt;I'm having the same issue, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt;. Let me know if you figured it out (you usually do). &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 23:34:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698148#M237108</guid>
      <dc:creator>ejwade</dc:creator>
      <dc:date>2024-09-03T23:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698373#M237153</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160850"&gt;@ejwade&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I’m a Community Moderator in the Splunk Community.&lt;/P&gt;&lt;P&gt;you are replying to question was posted couple of&amp;nbsp; years ago, so it might not get the attention you need for your question to be answered. We recommend that you post a new question with errors so that your issue can get the &amp;nbsp;visibility it deserves. To increase your chances of getting help from the community, follow&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunkbase/splunkbase/Answers/Questions" target="_blank" rel="nofollow noopener noreferrer"&gt;&lt;U&gt;these guidelines&lt;/U&gt;&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the Splunk Answers User Manual when creating your post.&lt;/P&gt;&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 06:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698373#M237153</guid>
      <dc:creator>SanjayReddy</dc:creator>
      <dc:date>2024-09-06T06:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I escape dollar-signs to use "map" or "sendemail" inside of a macro or workflow?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698375#M237155</link>
      <description>&lt;P&gt;And back to the original question - I suspect it's just how it works. Macro expansion is after all just a simple string substitution, there is no complicated magic behind it. If it's something that could be useful, you might consider posting an idea on &lt;A href="https://ideas.splunk.com" target="_blank"&gt;https://ideas.splunk.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 07:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-escape-dollar-signs-to-use-quot-map-quot-or-quot/m-p/698375#M237155</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-09-06T07:29:13Z</dc:date>
    </item>
  </channel>
</rss>

