<?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: Inconsistency in eval behavior in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304586#M91558</link>
    <description>&lt;P&gt;To properly set the earliest time for the search. We have data only for 5 mins granularity. 11:05, 11:10 ... So if the search running at 12:13 to get past one hour data earliest time is set as 11:13, we want to set it as 11:10&lt;/P&gt;

&lt;P&gt;We achieved this by using  &lt;CODE&gt;time()&lt;/CODE&gt;. &lt;CODE&gt;now()&lt;/CODE&gt; doesn't work with &lt;CODE&gt;iseval =1&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 14:23:59 GMT</pubDate>
    <dc:creator>immortalraghava</dc:creator>
    <dc:date>2018-06-28T14:23:59Z</dc:date>
    <item>
      <title>Inconsistency in eval behavior</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304583#M91555</link>
      <description>&lt;P&gt;I have a sample search with an eval statement which works, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = _internal | head 1 | eval temp = strftime(now(),"%M") | table temp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But when I try to add the same to a macro, it doesn't work. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[find_current_min]
definition = strftime(now(),"%M")
iseval = 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the following error when I try to call the macro  `find_current_min`&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://community.splunk.com/storage/temp/228846-capture.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Please explain this strange behavior. &lt;/P&gt;

&lt;P&gt;Any help appreciated.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304583#M91555</guid>
      <dc:creator>immortalraghava</dc:creator>
      <dc:date>2020-09-29T18:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency in eval behavior</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304584#M91556</link>
      <description>&lt;P&gt;hi immortalraghavan,&lt;BR /&gt;
To do what you want, you don't need a macro, but a calculated field [Setting -- Fields -- Calculated fields] and don't need also of eval command.&lt;/P&gt;

&lt;P&gt;Only for my curiosity, why you need the now minute?&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 12:36:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304584#M91556</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-02-22T12:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency in eval behavior</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304585#M91557</link>
      <description>&lt;P&gt;I agree with @cusello that this would be a good use case for a Calculated Field, but you should also be able to make this work as it stands by simply changing &lt;CODE&gt;iseval = 1&lt;/CODE&gt; to &lt;CODE&gt;iseval = 0&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;As per the documentation for &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.2/Admin/Macrosconf"&gt;macros.conf&lt;/A&gt;, this setting should only be set to 1 if &lt;EM&gt;"the definition attribute is expected to be an eval expression that returns a string that represents the expansion of this macro."&lt;/EM&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 15:04:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304585#M91557</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-22T15:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency in eval behavior</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304586#M91558</link>
      <description>&lt;P&gt;To properly set the earliest time for the search. We have data only for 5 mins granularity. 11:05, 11:10 ... So if the search running at 12:13 to get past one hour data earliest time is set as 11:13, we want to set it as 11:10&lt;/P&gt;

&lt;P&gt;We achieved this by using  &lt;CODE&gt;time()&lt;/CODE&gt;. &lt;CODE&gt;now()&lt;/CODE&gt; doesn't work with &lt;CODE&gt;iseval =1&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 14:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistency-in-eval-behavior/m-p/304586#M91558</guid>
      <dc:creator>immortalraghava</dc:creator>
      <dc:date>2018-06-28T14:23:59Z</dc:date>
    </item>
  </channel>
</rss>

