<?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 Converting @d for eval command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499983#M195054</link>
    <description>&lt;P&gt;I am trying to use the token passed through the time input in a dashboard to a search query. In this specific example, I am trying to do the following&lt;/P&gt;

&lt;P&gt;|eval date=strptime($timepicker.latest$,"%H:%M")&lt;/P&gt;

&lt;P&gt;If I select the default time as 'today' or 'yesterday', the value for timepicker is sent as &lt;STRONG&gt;@d&lt;/STRONG&gt; and the eval command cannot extract the hour and minute, rather, it fails with the following &lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '@d,"%H:%M")'. How can I pass through the timepicker token as a converted epoch formatted time. &lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 05:43:37 GMT</pubDate>
    <dc:creator>kunwarjit</dc:creator>
    <dc:date>2019-12-03T05:43:37Z</dc:date>
    <item>
      <title>Converting @d for eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499983#M195054</link>
      <description>&lt;P&gt;I am trying to use the token passed through the time input in a dashboard to a search query. In this specific example, I am trying to do the following&lt;/P&gt;

&lt;P&gt;|eval date=strptime($timepicker.latest$,"%H:%M")&lt;/P&gt;

&lt;P&gt;If I select the default time as 'today' or 'yesterday', the value for timepicker is sent as &lt;STRONG&gt;@d&lt;/STRONG&gt; and the eval command cannot extract the hour and minute, rather, it fails with the following &lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. An unexpected character is reached at '@d,"%H:%M")'. How can I pass through the timepicker token as a converted epoch formatted time. &lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 05:43:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499983#M195054</guid>
      <dc:creator>kunwarjit</dc:creator>
      <dc:date>2019-12-03T05:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Converting @d for eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499984#M195055</link>
      <description>&lt;P&gt;@kunwarjit &lt;/P&gt;

&lt;P&gt;Here I suggest to use &lt;CODE&gt;addinfo&lt;/CODE&gt; search command. You will get time boundary as fields in epochtime. So you can use directly as per your need.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;info_min_time&lt;/CODE&gt; : The earliest time boundary for the search.&lt;BR /&gt;
&lt;CODE&gt;info_max_time&lt;/CODE&gt; The latest time boundary for the search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | addinfo |eval date=strftime(info_max_time,"%H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Addinfo"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Addinfo&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499984#M195055</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-03T12:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: Converting @d for eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499985#M195056</link>
      <description>&lt;P&gt;Coincidentally enough, code was just posted for this a few days ago here (be sure to &lt;CODE&gt;UpVote&lt;/CODE&gt;:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/786365/can-some-one-explain-me-the-function-of-the-below.html#answer-787384"&gt;https://answers.splunk.com/answers/786365/can-some-one-explain-me-the-function-of-the-below.html#answer-787384&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 16:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499985#M195056</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-03T16:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Converting @d for eval command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499986#M195057</link>
      <description>&lt;P&gt;Thanks, works like a charm!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 22:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Converting-d-for-eval-command/m-p/499986#M195057</guid>
      <dc:creator>kunwarjit</dc:creator>
      <dc:date>2019-12-03T22:14:39Z</dc:date>
    </item>
  </channel>
</rss>

