<?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: Can you help me integrate a lookup into a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389779#M113565</link>
    <description>&lt;P&gt;For performance purposes, its always better to have a stats before the lookup. Place it like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_main "SFP receive power low  alarm set" 
 | stats dc(date_mday) as Days, count by TID, J_Port | eval c_TID=upper(c_TID) 
| lookup filename.csv hostname AS host OUTPUT ROLE
 | where Days &amp;gt; 2 AND count &amp;gt; 49 | appendpipe [stats count | where count=0]
 | rename count as "Total Errors", TID as Hostname, J_Port as Port
 | sort -"Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 25 Sep 2018 15:30:35 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2018-09-25T15:30:35Z</dc:date>
    <item>
      <title>Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389775#M113561</link>
      <description>&lt;P&gt;I am trying to integrate a lookup into a search with no success.  My goal is to run the search, lookup the hostname or TID and compare it to the lookup table (HOSTNAME field) and return results based on matches to the ROLE field.  The ROLE column in the lookup that defines whether TID is core, cpe or aggregation. Here is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_main "SFP receive power low  alarm set" 
| stats dc(date_mday) as Days, count by TID, J_Port | eval c_TID=upper(c_TID) 
| where Days &amp;gt; 2 AND count &amp;gt; 49 | appendpipe [stats count | where count=0]
| rename count as "Total Errors", TID as Hostname, J_Port as Port
| sort -"Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The lookup table file and definition are working. My difficulty is integrating it into my search.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 21:15:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389775#M113561</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-09-24T21:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389776#M113562</link>
      <description>&lt;P&gt;I don't see your lookup in the search. It should follow this format &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| lookup filename.csv hostname AS host OUTPUT ROLE&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 21:29:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389776#M113562</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-09-24T21:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389777#M113563</link>
      <description>&lt;P&gt;I didn't include it in the search because no matter where I try it, I get an error back when it is executed. Any guidance as to the proper placement of the lookup is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 15:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389777#M113563</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-09-25T15:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389778#M113564</link>
      <description>&lt;P&gt;Place it at the end of the search, and if you still get the error please paste the complete search with lookup and the error message.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2018 15:26:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389778#M113564</guid>
      <dc:creator>Vijeta</dc:creator>
      <dc:date>2018-09-25T15:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389779#M113565</link>
      <description>&lt;P&gt;For performance purposes, its always better to have a stats before the lookup. Place it like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=my_main "SFP receive power low  alarm set" 
 | stats dc(date_mday) as Days, count by TID, J_Port | eval c_TID=upper(c_TID) 
| lookup filename.csv hostname AS host OUTPUT ROLE
 | where Days &amp;gt; 2 AND count &amp;gt; 49 | appendpipe [stats count | where count=0]
 | rename count as "Total Errors", TID as Hostname, J_Port as Port
 | sort -"Total Errors"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Sep 2018 15:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389779#M113565</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-09-25T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me integrate a lookup into a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389780#M113566</link>
      <description>&lt;P&gt;It's working now. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 14:56:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-integrate-a-lookup-into-a-search/m-p/389780#M113566</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2018-09-26T14:56:26Z</dc:date>
    </item>
  </channel>
</rss>

