<?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 How to pass a value by reference into a macro?  Do I used eval-based definition, and if so, how does it work? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/634984#M15747</link>
    <description>&lt;P&gt;I wrote a simple macro for a string builder for a full name when passed params for FirstName, MiddleName, and LastName.;&amp;nbsp; first screenshot - the macro definition&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can pass the values explicitly to the macro but not by reference from the query that invokes the macro;&amp;nbsp; second screenshot shows the behavior of the macro both when I explicitly pass the values to it and when I attempt to do so by reference when "Use eval-based definition": is NOT checked.&lt;/P&gt;&lt;P&gt;If I DO check the box for "Use eval-based definition",&amp;nbsp; I get the following error:&lt;BR /&gt;"&lt;SPAN&gt;Error in 'SearchParser': The definition of macro 'CRE_getFullNameTEST(3)' is expected to be an eval expression that returns a string.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;What do I have to do to be able to pass the values contained within FirstName, MiddleName, and LastName to my macro?&lt;/P&gt;&lt;P&gt;Thanks for any assistance with this.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Macro definition" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24362i15FF5357B4C996C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="getFullName_macro_definition.png" alt="Macro definition" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Macro definition&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SPL that invokes macro" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24363i343A3D804E9D81A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="getFullNameFromMacroSPL.png" alt="SPL that invokes macro" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SPL that invokes macro&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2023 20:58:28 GMT</pubDate>
    <dc:creator>gmagnant</dc:creator>
    <dc:date>2023-03-17T20:58:28Z</dc:date>
    <item>
      <title>How to pass a value by reference into a macro?  Do I used eval-based definition, and if so, how does it work?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/634984#M15747</link>
      <description>&lt;P&gt;I wrote a simple macro for a string builder for a full name when passed params for FirstName, MiddleName, and LastName.;&amp;nbsp; first screenshot - the macro definition&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I can pass the values explicitly to the macro but not by reference from the query that invokes the macro;&amp;nbsp; second screenshot shows the behavior of the macro both when I explicitly pass the values to it and when I attempt to do so by reference when "Use eval-based definition": is NOT checked.&lt;/P&gt;&lt;P&gt;If I DO check the box for "Use eval-based definition",&amp;nbsp; I get the following error:&lt;BR /&gt;"&lt;SPAN&gt;Error in 'SearchParser': The definition of macro 'CRE_getFullNameTEST(3)' is expected to be an eval expression that returns a string.&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;What do I have to do to be able to pass the values contained within FirstName, MiddleName, and LastName to my macro?&lt;/P&gt;&lt;P&gt;Thanks for any assistance with this.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Macro definition" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24362i15FF5357B4C996C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="getFullName_macro_definition.png" alt="Macro definition" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Macro definition&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SPL that invokes macro" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24363i343A3D804E9D81A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="getFullNameFromMacroSPL.png" alt="SPL that invokes macro" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;SPL that invokes macro&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 20:58:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/634984#M15747</guid>
      <dc:creator>gmagnant</dc:creator>
      <dc:date>2023-03-17T20:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a value by reference into a macro?  Do I used eval-based definition, and if so, how does it work?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/635007#M15748</link>
      <description>&lt;P&gt;Try it this way&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_0-1679127152455.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24364i356329197449B7BE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_0-1679127152455.png" alt="ITWhisperer_0-1679127152455.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITWhisperer_1-1679127250607.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/24365i1B117DA80CBA1296/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITWhisperer_1-1679127250607.png" alt="ITWhisperer_1-1679127250607.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 08:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/635007#M15748</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-18T08:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a value by reference into a macro?  Do I used eval-based definition, and if so, how does it work?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/635133#M15751</link>
      <description>&lt;P&gt;Many thanks for pointing out the syntax for concatenating a string in the macro.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works like a charm now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I can go create my dashboard URL builder macro which will be used to send the URL via Splunk alert into a ticketing application.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 12:54:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-pass-a-value-by-reference-into-a-macro-Do-I-used-eval/m-p/635133#M15751</guid>
      <dc:creator>gmagnant</dc:creator>
      <dc:date>2023-03-20T12:54:05Z</dc:date>
    </item>
  </channel>
</rss>

