<?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: how to add a column &amp;quot;seen in last 24 hours&amp;quot; to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330109#M61195</link>
    <description>&lt;P&gt;Thanks for the response somesoni2. I have got an error when tried with the first answer as below &lt;/P&gt;

&lt;P&gt;Error in 'map' command: Unable to find saved search 'maxsearches=1000'.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 14:09:30 GMT</pubDate>
    <dc:creator>pavanae</dc:creator>
    <dc:date>2017-09-12T14:09:30Z</dc:date>
    <item>
      <title>how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330103#M61189</link>
      <description>&lt;P&gt;I have a query which contains multiple csv files as lookup tables and their result contains list of hosts and their details as follows with a count of more than 900. &lt;/P&gt;

&lt;P&gt;host        status         ip           X               Y            Z          &lt;/P&gt;

&lt;P&gt;Now is there any way that I can add a column as below&lt;/P&gt;

&lt;P&gt;host        status         ip           X               Y            Z               last_seen_in_24_hours&lt;BR /&gt;
1                                                                                                        yes&lt;BR /&gt;
2                                                                                                         no&lt;BR /&gt;&lt;BR /&gt;
3                                                                                                        yes&lt;/P&gt;

&lt;P&gt;How to see whether the list of hosts from the csv file were reporting into splunk from last 24 hours as above?&lt;/P&gt;

&lt;P&gt;Note :-&lt;/P&gt;

&lt;P&gt;I am able to verify the last reporting time individually by searching as below but not sure how to update the details in the same report by using a query?&lt;/P&gt;

&lt;P&gt;host="1"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Updated Query :-&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| inputlookup csv1 | table host, status, ip, X, Y, Z | append [|inputlookup csv2 | fields host, status, ip, X, Y, Z] | join type=outer ip [inputlookup csv3 |rename ip_adress as ip] &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:43:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330103#M61189</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2020-09-29T15:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330104#M61190</link>
      <description>&lt;P&gt;You can try these (select timerange higher than last 24 h)&lt;/P&gt;

&lt;P&gt;Slow performance &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup yourlookup.csv | table host status ip X Y Z
| map maxsearches=1000 "| tstats max(_time) as _time WHERE index=* host=$host$ by host | eval status=\"$status$\" | eval ip=\"$ip$\" | eval X=\"$X$\"  | eval Y=\"$Y$\" | eval Z=\"$Z$\" | eval last_seen_in_24_hours=if(_time&amp;gt;=relative_time(now(),\"-24h\"),\"yes\",\"no\") "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats max(_time) as _time WHERE index=* [| inputlookup yourlookup.csv | table host ] by host | eval last_seen_in_24_hours=if(_time&amp;gt;=relative_time(now(),"-24h"),"yes","no") | lookup  yourlookup.csv host OUTPUT ip status X Y Z
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Sep 2017 21:31:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330104#M61190</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-11T21:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330105#M61191</link>
      <description>&lt;P&gt;Adding a column is very simple. Just do an eval and assign a dummy column. Example below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup geo_attr_countries.csv | eval last_seen_in_24_hours="hello"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For your query, the exact command would be something like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup &amp;lt;your_csv&amp;gt; 
|  join type=left host [|metadata type=hosts index=* ] 
|eval lastTime=if(lastTime&amp;gt;0,lastTime,0)
|eval timeDiff=now()-lastTime
| eval last_seen_in_24_hours=if(timeDiff&amp;gt;86400,"NO","YES")
| eval lastReported=strftime(lastTime,"%F %T")
| table host,last_seen_in_24_hours,lastReported
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Sep 2017 21:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330105#M61191</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-09-11T21:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330106#M61192</link>
      <description>&lt;P&gt;Like this (use any &lt;CODE&gt;timepicker&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Your Existing Search Here
| rename COMMENT AS "It should use several '|inputlookup append=t' statements"
| appendpipe [| metadata type=hosts
              | eval lastSeen=max(lastTime, recentTime)
              | eval secondsPerDay = 60*60*24
              | eval now=now()
              | eval last_seen_in_24_hours=if(((now - lastSeen) &amp;gt;= secondsPerDay), "yes", "no")
              | table host last_seen_in_24_hours]
| stats values(*) AS * BY host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Sep 2017 21:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330106#M61192</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-11T21:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330107#M61193</link>
      <description>&lt;P&gt;thanks for the response woodcock. Could you provide some more information for the second line. I don't exactly understood what it meant&lt;/P&gt;

&lt;P&gt;| rename COMMENT AS "It should use several '|inputlookup append=t' statements"&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:02:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330107#M61193</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330108#M61194</link>
      <description>&lt;P&gt;thanks for the response Koshyk. I have a totall of around 3 csv files with different host fields. Could you modify the existing query to include all the host's from 3 csv files(all host's fields combined count 1000)&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330108#M61194</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330109#M61195</link>
      <description>&lt;P&gt;Thanks for the response somesoni2. I have got an error when tried with the first answer as below &lt;/P&gt;

&lt;P&gt;Error in 'map' command: Unable to find saved search 'maxsearches=1000'.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:09:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330109#M61195</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330110#M61196</link>
      <description>&lt;P&gt;You did not show us how you are pulling in the CSV files and I suspect that you are doing it poorly with &lt;CODE&gt;join&lt;/CODE&gt; or something.  The comment is pointing out that you should be using a string of  &lt;CODE&gt;|inputcsv append=t&lt;/CODE&gt; commands for that part.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:18:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330110#M61196</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-09-12T14:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330111#M61197</link>
      <description>&lt;P&gt;Please see the my updated query in the question and let me know how the final query could be to solve my question?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:30:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330111#M61197</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330112#M61198</link>
      <description>&lt;P&gt;Please see the my updated query in the question and let me know how the final query could be to solve my question?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330112#M61198</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330113#M61199</link>
      <description>&lt;P&gt;Please see the my updated query in the question and let me know how the final query could be to solve my question?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330113#M61199</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T14:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330114#M61200</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats max(_time) as _time WHERE index=* [| inputlookup csv1 | table host, status, ip, X, Y, Z | inputlookup csv2 append=t ] | table host ]  by host  | eval last_seen_in_24_hours=if(_time&amp;gt;=relative_time(now(),"-24h"),"yes","no") |  inputlookup csv1 append=t | table host, status, ip, X, Y, Z | inputlookup csv2 append=t  | join type=outer ip [inputlookup csv3 |rename ip_adress as ip]  | stats values(*) as * by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Sep 2017 14:46:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330114#M61200</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-12T14:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to add a column "seen in last 24 hours" to my current report and verify  the list of hosts from the csv file were reporting into splunk from last 24 hours or not?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330115#M61201</link>
      <description>&lt;P&gt;please refer to the below question also which I had posted for the same requirement &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/572402/search-help-my-search-is-innacurately-showing-if-h.html"&gt;https://answers.splunk.com/answers/572402/search-help-my-search-is-innacurately-showing-if-h.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 22:49:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/how-to-add-a-column-quot-seen-in-last-24-hours-quot-to-my/m-p/330115#M61201</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2017-09-12T22:49:22Z</dc:date>
    </item>
  </channel>
</rss>

