<?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: Question about lookups in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Question-about-lookups/m-p/51230#M12357</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup myserverlookup
| join type=outer host 
    [ search index=_internal sourcetype=splunkd source=*metrics* "group=per_host_thruput"  earliest=-24h
    | stats sum(ev) as events by series 
    | fields - host 
    | rename series as host ]
| join type=outer host [ | metadata type=hosts index=* | fields host lastTime ] 
| fieldformat lastTime = strftime(lastTime,"%x %X") 
| fieldformat events = tostring(events,"commas")
| sort host
| fields host events lastTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that your lookup is called &lt;CODE&gt;myserverlookup&lt;/CODE&gt; and that the field name in the associated csv is &lt;CODE&gt;host&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;This search tries to do things efficiently - instead of looking at all the indexes and counting up all the events - which would take a long time - it uses Splunk's internal metrics to count the events and the last time an event arrived from each host.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Dec 2012 20:32:53 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2012-12-02T20:32:53Z</dc:date>
    <item>
      <title>Question about lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-lookups/m-p/51229#M12356</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;hopefully someone can give me an advise.&lt;/P&gt;

&lt;P&gt;On the one hand I am having a lookup file which contains only simple server names, for instance&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Server A
Server B
Server C
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From some of them I am having logs, from some of them not. The goal is to create a table which contains all my servers in the lookup file. And then I want to have a another field which contains informations about how often I've got logs from them servers. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Server A   116 Events 
Server B   690 Events
Server C   0 Events
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can I realise this? I only want to see servers from my lookup file, and I also want to see if the server sends zero events. &lt;/P&gt;

&lt;P&gt;Thank you very much&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2012 15:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-lookups/m-p/51229#M12356</guid>
      <dc:creator>nebel</dc:creator>
      <dc:date>2012-12-02T15:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Question about lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Question-about-lookups/m-p/51230#M12357</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup myserverlookup
| join type=outer host 
    [ search index=_internal sourcetype=splunkd source=*metrics* "group=per_host_thruput"  earliest=-24h
    | stats sum(ev) as events by series 
    | fields - host 
    | rename series as host ]
| join type=outer host [ | metadata type=hosts index=* | fields host lastTime ] 
| fieldformat lastTime = strftime(lastTime,"%x %X") 
| fieldformat events = tostring(events,"commas")
| sort host
| fields host events lastTime
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that your lookup is called &lt;CODE&gt;myserverlookup&lt;/CODE&gt; and that the field name in the associated csv is &lt;CODE&gt;host&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;This search tries to do things efficiently - instead of looking at all the indexes and counting up all the events - which would take a long time - it uses Splunk's internal metrics to count the events and the last time an event arrived from each host.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Dec 2012 20:32:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Question-about-lookups/m-p/51230#M12357</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-12-02T20:32:53Z</dc:date>
    </item>
  </channel>
</rss>

