<?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: Macro returns no result when applied in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94437#M24347</link>
    <description>&lt;P&gt;Thanks .Worked with : definition = "127.0.0.1"&lt;/P&gt;</description>
    <pubDate>Fri, 11 Oct 2013 14:22:44 GMT</pubDate>
    <dc:creator>klausJohan</dc:creator>
    <dc:date>2013-10-11T14:22:44Z</dc:date>
    <item>
      <title>Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94431#M24341</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Could someone explain what am I doing wrong in using a macro ?&lt;/P&gt;

&lt;P&gt;Here is the macros.conf file &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[GET_IP]
definition = 127.0.0.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search query I intend to use is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="mySource" AND object.ip_address='GET_IP'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, if I paste the above query in the search bar  I obtain no result . On the other hand if I do the same thing for the expanded query &lt;CODE&gt;(source="mySource" AND object.ip_address=127.0.0.1)&lt;/CODE&gt; I get all the events back .&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 12:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94431#M24341</guid>
      <dc:creator>klausJohan</dc:creator>
      <dc:date>2013-10-11T12:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94432#M24342</link>
      <description>&lt;P&gt;You need to use backticks, not quotes, and probably make it eval macro.&lt;/P&gt;

&lt;P&gt;macros.conf&lt;BR /&gt;
&lt;CODE&gt;[GET_IP]&lt;BR /&gt;
definition = "\"127.0.0.1\""&lt;BR /&gt;
iseval = true&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
source="mySource" object.ip_address=&lt;BACKTICK&gt;GET_IP&lt;BACKTICK&gt;&lt;BR /&gt;
&lt;/BACKTICK&gt;&lt;/BACKTICK&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94432#M24342</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2020-09-28T14:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94433#M24343</link>
      <description>&lt;P&gt;The "backtip " opened my eyes about how to properly use a macro in a search. Now I obtain an error : Error in 'SearchParser': Could not find macro 'GET_IP' that takes 0 arguments. Expecting stanza name 'GET_IP'.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94433#M24343</guid>
      <dc:creator>klausJohan</dc:creator>
      <dc:date>2020-09-28T14:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94434#M24344</link>
      <description>&lt;P&gt;try this url: &lt;CODE&gt;&lt;A href="http://your_splunk:8000/en-US/debug/refresh/?entity=admin/macros" target="test_blank"&gt;http://your_splunk:8000/en-US/debug/refresh/?entity=admin/macros&lt;/A&gt;&lt;/CODE&gt; and then try your search again.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 13:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94434#M24344</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-11T13:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94435#M24345</link>
      <description>&lt;P&gt;Thanks. I'm still getting an error back . This time is "Error in 'SearchParser': The definition of macro 'GET_IP' is expected to be an eval expression that returns a string"&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 13:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94435#M24345</guid>
      <dc:creator>klausJohan</dc:creator>
      <dc:date>2013-10-11T13:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94436#M24346</link>
      <description>&lt;P&gt;try your initial definition.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 13:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94436#M24346</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-10-11T13:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro returns no result when applied</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94437#M24347</link>
      <description>&lt;P&gt;Thanks .Worked with : definition = "127.0.0.1"&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2013 14:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Macro-returns-no-result-when-applied/m-p/94437#M24347</guid>
      <dc:creator>klausJohan</dc:creator>
      <dc:date>2013-10-11T14:22:44Z</dc:date>
    </item>
  </channel>
</rss>

