<?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: Devices or sourcetypes not sednig logs in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Devices-or-sourcetypes-not-sednig-logs/m-p/378178#M95003</link>
    <description>&lt;P&gt;try something like this if the device has the &lt;CODE&gt;host&lt;/CODE&gt; filed. if not, convert to use &lt;CODE&gt;stats&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats min(_time) as first_event max(_time) as last_event where index=* by host
| eval now_time = now() 
| eval gap_from_last_event = now_time - last_event
| eval first_human = strftime(first_event, "%c")
| eval last_human = strftime(last_event, "%c")
| eval HMS_diff = tostring(gap_from_last_event, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jul 2019 11:49:29 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-07-03T11:49:29Z</dc:date>
    <item>
      <title>Devices or sourcetypes not sednig logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Devices-or-sourcetypes-not-sednig-logs/m-p/378177#M95002</link>
      <description>&lt;P&gt;Its a bit complicated query but let me explain.&lt;BR /&gt;
One device=a start sending logs after 3 months. befor 3 months there was logs and LAST LOG/EVENT RECEIVED YESTERDAY. &lt;/P&gt;

&lt;P&gt;So i want to see earliest, latest and difference between noew() and latest event.&lt;/P&gt;

&lt;P&gt;dvc/host                       latestTime                             earliestTime                               &lt;STRONG&gt;daydiff&lt;/STRONG&gt;&lt;BR /&gt;
1                                   07/02/2019 09:40:55         04/04/2019 00:01:13              &lt;STRONG&gt;01/02/1970 07:27:59&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;below is my query:&lt;/P&gt;

&lt;P&gt;index=xxx&lt;BR /&gt;
|  stats latest(_time) as latestTime, earliest(_time) as earliestTime by dvc&lt;BR /&gt;
|  convert ctime(latestTime) as latestTime, ctime(earliestTime) as earliestTime&lt;/P&gt;

&lt;P&gt;and when I add below:&lt;/P&gt;

&lt;P&gt;index=xxx&lt;BR /&gt;
|  stats latest(_time) as latestTime, earliest(_time) as earliestTime by dvc &lt;BR /&gt;
|  eval daydiff = (now()-latestTime)&lt;BR /&gt;
|  convert ctime(latestTime) as latestTime, ctime(earliestTime) as earliestTime, ctime(daydiff)&lt;/P&gt;

&lt;P&gt;the daydiff field show the result = 01/01/1970 &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Devices-or-sourcetypes-not-sednig-logs/m-p/378177#M95002</guid>
      <dc:creator>riqbal47010</dc:creator>
      <dc:date>2020-09-30T01:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Devices or sourcetypes not sednig logs</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Devices-or-sourcetypes-not-sednig-logs/m-p/378178#M95003</link>
      <description>&lt;P&gt;try something like this if the device has the &lt;CODE&gt;host&lt;/CODE&gt; filed. if not, convert to use &lt;CODE&gt;stats&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats min(_time) as first_event max(_time) as last_event where index=* by host
| eval now_time = now() 
| eval gap_from_last_event = now_time - last_event
| eval first_human = strftime(first_event, "%c")
| eval last_human = strftime(last_event, "%c")
| eval HMS_diff = tostring(gap_from_last_event, "duration")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 11:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Devices-or-sourcetypes-not-sednig-logs/m-p/378178#M95003</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-07-03T11:49:29Z</dc:date>
    </item>
  </channel>
</rss>

