<?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 Check Critical Assets that are Logging in Reporting</title>
    <link>https://community.splunk.com/t5/Reporting/Check-Critical-Assets-that-are-Logging/m-p/694416#M12575</link>
    <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;So I have a lookup table with the following fields: FQDN, Hostname, and IP. I need to check to see which of these assets in the lookup table are logging (about 700 assets) and which aren't in the last 7 days. I used the following basic SPL to get a list of hosts which are logging:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats earliest(_time) latest(_time) count where index=* earliest=-7d by host
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I'm having is that the host output in the above SPL comes through in different formats, it may be a FQDN or a Hostname, or an IP address. How do I use my lookup table to check if the assets in the lookup table are logging without having to do 3 joins on FQDN, Hostname and IP? Here was a SPL query that somewhat worked but it is too inefficient:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup.csv
| eval FQDN=lower(FQDN)
| eval Hostname=lower(Hostname)
| join type=left FQDN [
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as FQDN
| eval FQDN=lower(FQDN)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| join type=left Hostname [
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as Hostname
| eval Hostname=lower(Hostname)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| join type=left IP[
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as IP
| eval IP=lower(IP)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| rename lastTime as LastTime
| fillnull value="NULL"
| table FQDN, Hostname, IP, Serial, LastTime, Days_Since_Last_Log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm somewhat new to Splunk so thank you for the help!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 14:39:29 GMT</pubDate>
    <dc:creator>Zer0F8th</dc:creator>
    <dc:date>2024-07-26T14:39:29Z</dc:date>
    <item>
      <title>Check Critical Assets that are Logging</title>
      <link>https://community.splunk.com/t5/Reporting/Check-Critical-Assets-that-are-Logging/m-p/694416#M12575</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;So I have a lookup table with the following fields: FQDN, Hostname, and IP. I need to check to see which of these assets in the lookup table are logging (about 700 assets) and which aren't in the last 7 days. I used the following basic SPL to get a list of hosts which are logging:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats earliest(_time) latest(_time) count where index=* earliest=-7d by host
 &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue I'm having is that the host output in the above SPL comes through in different formats, it may be a FQDN or a Hostname, or an IP address. How do I use my lookup table to check if the assets in the lookup table are logging without having to do 3 joins on FQDN, Hostname and IP? Here was a SPL query that somewhat worked but it is too inefficient:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup lookup.csv
| eval FQDN=lower(FQDN)
| eval Hostname=lower(Hostname)
| join type=left FQDN [
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as FQDN
| eval FQDN=lower(FQDN)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| join type=left Hostname [
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as Hostname
| eval Hostname=lower(Hostname)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| join type=left IP[
|tstats latest(_time) as lastTime where index=* earliest=-7d by host 
| rename host as IP
| eval IP=lower(IP)
| eval Days_Since_Last_Log = round((now() - lastTime) / 86400) 
| convert ctime(lastTime)
]
| rename lastTime as LastTime
| fillnull value="NULL"
| table FQDN, Hostname, IP, Serial, LastTime, Days_Since_Last_Log&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm somewhat new to Splunk so thank you for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 14:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Check-Critical-Assets-that-are-Logging/m-p/694416#M12575</guid>
      <dc:creator>Zer0F8th</dc:creator>
      <dc:date>2024-07-26T14:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Check Critical Assets that are Logging</title>
      <link>https://community.splunk.com/t5/Reporting/Check-Critical-Assets-that-are-Logging/m-p/694425#M12576</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270518"&gt;@Zer0F8th&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to start from the main search, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| tstats 
     count 
     WHERE index=* earliest=-7d 
     BY host
| append [
     | inputlookup lookup.csv | eval count=0 | fields FQDN count ]
| append [
     | inputlookup lookup.csv | eval count=0 | fields IP count ]
| append [
     | inputlookup lookup.csv | eval count=0 | fields Hostname count ]
| eval host=coalesce(host, FQDN, IP, Hostname)
| stats sum(count) AS total BY host
| where total=0&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 15:00:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Reporting/Check-Critical-Assets-that-are-Logging/m-p/694425#M12576</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-26T15:00:16Z</dc:date>
    </item>
  </channel>
</rss>

