<?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: Using eval to create date in epoch time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356485#M105475</link>
    <description>&lt;P&gt;this did the trick, thank you!!&lt;/P&gt;</description>
    <pubDate>Fri, 22 Dec 2017 16:50:51 GMT</pubDate>
    <dc:creator>hcannon</dc:creator>
    <dc:date>2017-12-22T16:50:51Z</dc:date>
    <item>
      <title>Using eval to create date in epoch time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356482#M105472</link>
      <description>&lt;P&gt;I need to create a field  &lt;CODE&gt;today&lt;/CODE&gt; that is equal to the epoch timestamp in milliseconds for midnight yesterday. I've been successful in using eval for this, but splunk is adding ".000" to the end of the field value and I can't for the life of me figure out why or how to remove .000, so that the value can be passed to a dbxquery formatted in milliseconds. &lt;/P&gt;

&lt;P&gt;I've tried using  &lt;CODE&gt;rex mode=sed field=today "s/.000//"&lt;/CODE&gt;, then attempted to convert the value to a string first, before sending to rex/sed.&lt;BR /&gt;
The .000 persists.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;...| eval today=(relative_time(now(),"-1d@d")*1000) | top today&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;search result:&lt;BR /&gt;
&lt;CODE&gt;today=1513832400000.000&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:11:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356482#M105472</guid>
      <dc:creator>hcannon</dc:creator>
      <dc:date>2017-12-22T16:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using eval to create date in epoch time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356483#M105473</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..| eval today=round(relative_time(now(),"-1d@d")*1000) | top today
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356483#M105473</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-22T16:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using eval to create date in epoch time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356484#M105474</link>
      <description>&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval today=round(relative_time(now(), “-1d@d”) * 1000, 0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:47:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356484#M105474</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-12-22T16:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using eval to create date in epoch time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356485#M105475</link>
      <description>&lt;P&gt;this did the trick, thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Dec 2017 16:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-eval-to-create-date-in-epoch-time/m-p/356485#M105475</guid>
      <dc:creator>hcannon</dc:creator>
      <dc:date>2017-12-22T16:50:51Z</dc:date>
    </item>
  </channel>
</rss>

