<?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 Using a value from a lookup table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121512#M32686</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;

&lt;P&gt;I have a lookup table I created that is derived from a saved search, and it counts the computers on the network each day. It is only a single line with the host count (host_count) and the time (search_time) it was done. I want to use that value in an equation, but I am having a hard time invoking it.&lt;/P&gt;

&lt;P&gt;I want it to look like:&lt;BR /&gt;
|stats count by patched_host | eval percent = (1-((host_count - count)/host_count)) &lt;BR /&gt;
So this would show me the percent of hosts patched.&lt;/P&gt;

&lt;P&gt;So my question is how to reference the lookup table that only has two values, host_count and time.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:56:27 GMT</pubDate>
    <dc:creator>jravida</dc:creator>
    <dc:date>2020-09-28T16:56:27Z</dc:date>
    <item>
      <title>Using a value from a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121512#M32686</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;

&lt;P&gt;I have a lookup table I created that is derived from a saved search, and it counts the computers on the network each day. It is only a single line with the host count (host_count) and the time (search_time) it was done. I want to use that value in an equation, but I am having a hard time invoking it.&lt;/P&gt;

&lt;P&gt;I want it to look like:&lt;BR /&gt;
|stats count by patched_host | eval percent = (1-((host_count - count)/host_count)) &lt;BR /&gt;
So this would show me the percent of hosts patched.&lt;/P&gt;

&lt;P&gt;So my question is how to reference the lookup table that only has two values, host_count and time.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:56:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121512#M32686</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2020-09-28T16:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a value from a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121513#M32687</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search  |stats count by patched_host | eval host_count=[|inputlookup dailyhosts.csv | return $host_count]| eval percent = (1-((host_count - count)/host_count))  | fields - host_count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jun 2014 19:30:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121513#M32687</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-06-26T19:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using a value from a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121514#M32688</link>
      <description>&lt;P&gt;You are a Splunk god. I gave you credit to my boss so he doesn't start thinking I'm smart.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jun 2014 20:11:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-value-from-a-lookup-table/m-p/121514#M32688</guid>
      <dc:creator>jravida</dc:creator>
      <dc:date>2014-06-26T20:11:18Z</dc:date>
    </item>
  </channel>
</rss>

