<?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 macro with calculated parameters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581743#M202661</link>
    <description>&lt;P&gt;I am trying to assign a value to a parameter in a macro that is based on a calculation of a value being sent to the macro but I do not get the expected result.&lt;BR /&gt;index=my_index ... earliest=exact($time$-4000) latest=$time$...&lt;BR /&gt;&lt;BR /&gt;How can I assign the earliest value which suppose to be 4,000 seconds less than the value $time$ ?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jan 2022 21:02:05 GMT</pubDate>
    <dc:creator>eranhauser</dc:creator>
    <dc:date>2022-01-19T21:02:05Z</dc:date>
    <item>
      <title>macro with calculated parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581743#M202661</link>
      <description>&lt;P&gt;I am trying to assign a value to a parameter in a macro that is based on a calculation of a value being sent to the macro but I do not get the expected result.&lt;BR /&gt;index=my_index ... earliest=exact($time$-4000) latest=$time$...&lt;BR /&gt;&lt;BR /&gt;How can I assign the earliest value which suppose to be 4,000 seconds less than the value $time$ ?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 21:02:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581743#M202661</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2022-01-19T21:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: macro with calculated parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581769#M202669</link>
      <description>&lt;P&gt;exact() is an eval operation, so you can't use that as part of what looks like your search query, it has to be done in an | eval .... statement&lt;/P&gt;&lt;P&gt;Can you give an example of how you are using the macro and at what point in the search? Where is your original time variable parameter coming from that you are passing in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jan 2022 22:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581769#M202669</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-01-19T22:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: macro with calculated parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581790#M202674</link>
      <description>&lt;P&gt;I am passing a unix date as the latest value and I would like to to set the earliest always to be 4,000 second less&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 01:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581790#M202674</guid>
      <dc:creator>eranhauser</dc:creator>
      <dc:date>2022-01-20T01:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro with calculated parameters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581793#M202676</link>
      <description>&lt;P&gt;How are you passing the date? Is this part of a dashboard query where the date comes from a token?&lt;/P&gt;&lt;P&gt;In your example it looks like your macro starts with 'index=...' so implies it's the start of a search or a subsearch, so I am assuming your date is coming from a token. If so, then there's probably a different way to do this, by setting the earliest to be 4000 seconds prior to the latest&lt;/P&gt;&lt;P&gt;Can you share more&amp;nbsp; about the context or your SPL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jan 2022 01:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/macro-with-calculated-parameters/m-p/581793#M202676</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-01-20T01:51:22Z</dc:date>
    </item>
  </channel>
</rss>

