<?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: finding the most recent sourcetype=hardware (similar to metadata command) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58465#M14308</link>
    <description>&lt;P&gt;i think this should do it, I will try this. thank you very much.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Mar 2013 18:42:57 GMT</pubDate>
    <dc:creator>lemikg</dc:creator>
    <dc:date>2013-03-23T18:42:57Z</dc:date>
    <item>
      <title>finding the most recent sourcetype=hardware (similar to metadata command)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58461#M14304</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;in my dashboard I have a table displaying the hardware configuration of a server and several other searches. So this is what I do, I pick a host, a timerange and hit search.&lt;BR /&gt;
Depending on the timerange the desired table shows no results.&lt;/P&gt;

&lt;P&gt;Is there a way to search for the most recent event of that stream / &lt;CODE&gt;sourcetype=hardware&lt;/CODE&gt; where the hardware information was logged?&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;

&lt;P&gt;regards&lt;BR /&gt;
mike&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 12:04:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58461#M14304</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-03-12T12:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: finding the most recent sourcetype=hardware (similar to metadata command)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58462#M14305</link>
      <description>&lt;P&gt;You could increase your timerange and use &lt;CODE&gt;|head 1&lt;/CODE&gt;. This returns the most recent in the timerange. You could also use a lookup generator. Run it every hour and then just lookup the host you want from the table. &lt;/P&gt;

&lt;P&gt;In transforms.conf put:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[hardware]&lt;BR /&gt;
filename = hardware.csv&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then populate the lookup (Run this as a scheduled search every hour, 30 minutes, 5 minutes, whatever you feel is appropriate to get the required data):&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=hardware | inputlookup hardware append=t | stats latest(*) as * by host | outputlookup hardware&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then in your search you can do:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search | lookup hardware host | do_things_with_hardware&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Ref:&lt;BR /&gt;
&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Lookup" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Lookup&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Inputlookup" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Inputlookup&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 12:19:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58462#M14305</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-03-12T12:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: finding the most recent sourcetype=hardware (similar to metadata command)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58463#M14306</link>
      <description>&lt;P&gt;hi alacercogitatus, thanks for your reply. I was thinking of the lookup too and is probably the easiest way. I wanted to avoid increasing the timerange but Due to the number of searches in that particular view and userfriendliness I hoped to find another way of solving this.&lt;/P&gt;

&lt;P&gt;From what I understand the metadata searches over time ie. indepently from the set timerange.&lt;/P&gt;

&lt;P&gt;I was hoping to find something similar. Do you have something in that direction on your mind?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 13:42:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58463#M14306</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-03-12T13:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: finding the most recent sourcetype=hardware (similar to metadata command)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58464#M14307</link>
      <description>&lt;P&gt;Well, you could use the timestamps in the metadata and do a second search.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|append [|metadata type=sourcetypes sourcetype=hardware|eval et=lastTime - (60*10)|convert timeformat="%m/%d/%Y:%H:%M:%S" ctime(et) as et|map search="search sourcetype=hardware earliest=$et$|head 1"]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This will return the events of the sourcetype.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2013 14:01:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58464#M14307</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-03-12T14:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: finding the most recent sourcetype=hardware (similar to metadata command)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58465#M14308</link>
      <description>&lt;P&gt;i think this should do it, I will try this. thank you very much.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2013 18:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/finding-the-most-recent-sourcetype-hardware-similar-to-metadata/m-p/58465#M14308</guid>
      <dc:creator>lemikg</dc:creator>
      <dc:date>2013-03-23T18:42:57Z</dc:date>
    </item>
  </channel>
</rss>

