<?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 My count is double. Can I use field from search to search lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311021#M93242</link>
    <description>&lt;P&gt;1) I have got a query whose output are events that contains a field called CV4_TExCd.&lt;BR /&gt;
The base query looks like this:&lt;BR /&gt;
 index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000&lt;BR /&gt;
2) I have a lookup table that has 2 columns, Site and TeamCode&lt;/P&gt;

&lt;P&gt;TeamCode    Site&lt;BR /&gt;
84001   SiteA&lt;BR /&gt;
84001   SiteA&lt;BR /&gt;
84002   SiteA&lt;BR /&gt;
84002   SiteA&lt;BR /&gt;
84003   SiteA&lt;BR /&gt;
9001    SiteB&lt;BR /&gt;
9001    SiteB&lt;BR /&gt;
9002    SiteB&lt;BR /&gt;
9002    SiteB&lt;BR /&gt;
9003    SiteB&lt;BR /&gt;
37001   SiteC&lt;BR /&gt;
37001   SiteC&lt;BR /&gt;
37002   SiteC&lt;BR /&gt;
37002   SiteC&lt;BR /&gt;
37003   SiteC&lt;/P&gt;

&lt;P&gt;3) I  want to search field CV4_TExCd against TeamCode from lookup table; when found count by Site &lt;/P&gt;

&lt;P&gt;4) I was playing around with this query below but I noticed that my count is doubled. I have no idea why! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000 _time=*  | lookup lookupTable TeamCode AS CV4_TExCd OUTPUT Site AS Site| stats count by Site&lt;/P&gt;

&lt;P&gt;Please help and thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 16:17:02 GMT</pubDate>
    <dc:creator>mmdacutanan</dc:creator>
    <dc:date>2020-09-29T16:17:02Z</dc:date>
    <item>
      <title>My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311021#M93242</link>
      <description>&lt;P&gt;1) I have got a query whose output are events that contains a field called CV4_TExCd.&lt;BR /&gt;
The base query looks like this:&lt;BR /&gt;
 index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000&lt;BR /&gt;
2) I have a lookup table that has 2 columns, Site and TeamCode&lt;/P&gt;

&lt;P&gt;TeamCode    Site&lt;BR /&gt;
84001   SiteA&lt;BR /&gt;
84001   SiteA&lt;BR /&gt;
84002   SiteA&lt;BR /&gt;
84002   SiteA&lt;BR /&gt;
84003   SiteA&lt;BR /&gt;
9001    SiteB&lt;BR /&gt;
9001    SiteB&lt;BR /&gt;
9002    SiteB&lt;BR /&gt;
9002    SiteB&lt;BR /&gt;
9003    SiteB&lt;BR /&gt;
37001   SiteC&lt;BR /&gt;
37001   SiteC&lt;BR /&gt;
37002   SiteC&lt;BR /&gt;
37002   SiteC&lt;BR /&gt;
37003   SiteC&lt;/P&gt;

&lt;P&gt;3) I  want to search field CV4_TExCd against TeamCode from lookup table; when found count by Site &lt;/P&gt;

&lt;P&gt;4) I was playing around with this query below but I noticed that my count is doubled. I have no idea why! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000 _time=*  | lookup lookupTable TeamCode AS CV4_TExCd OUTPUT Site AS Site| stats count by Site&lt;/P&gt;

&lt;P&gt;Please help and thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:17:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311021#M93242</guid>
      <dc:creator>mmdacutanan</dc:creator>
      <dc:date>2020-09-29T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311022#M93243</link>
      <description>&lt;P&gt;Hi &lt;BR /&gt;
Can you please try this one?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000 _time=* | dedup CV4_TExCd | lookup lookupTable TeamCode AS CV4_TExCd OUTPUT Site AS Site| stats count by Site
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 12:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311022#M93243</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2017-10-19T12:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311023#M93244</link>
      <description>&lt;P&gt;I'd imagine that's because you have duplicate entries in your lookup table. You could either delete the duplicate entries in the lookup table:&lt;BR /&gt;
&lt;CODE&gt;| inputlookup lookupTable | dedup TeamCode Site | outputlookup lookupTable&lt;/CODE&gt;&lt;BR /&gt;
or if you just want to get a count of all distinct Site values:&lt;BR /&gt;
&lt;CODE&gt;index=ivr sourcetype=ivr_SEF applicationName=TestApp CV4_TExCd!=000000 _time=* | lookup lookupTable TeamCode AS CV4_TExCd OUTPUT Site AS Site| stats dc(Site) AS site_count&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:01:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311023#M93244</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-19T13:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311024#M93245</link>
      <description>&lt;P&gt;Most of the entries in your sample lookup table are duplicates.  If that is true in the real file, try removing the duplicate entries from the lookup or add &lt;CODE&gt;| dedup TeamCode&lt;/CODE&gt; before &lt;CODE&gt;|stats&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 13:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311024#M93245</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-10-19T13:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311025#M93246</link>
      <description>&lt;P&gt;Thanks Rich! That was it. I had modified the lookup table and getting the right results now &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; THank you!!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 23:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311025#M93246</guid>
      <dc:creator>mmdacutanan</dc:creator>
      <dc:date>2017-10-19T23:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311026#M93247</link>
      <description>&lt;P&gt;I corrected my lookup table. That corrected my issue. I thought my query was wrong but it was the lookup table! Thanks Elliot! &lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 23:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311026#M93247</guid>
      <dc:creator>mmdacutanan</dc:creator>
      <dc:date>2017-10-19T23:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: My count is double. Can I use field from search to search lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311027#M93248</link>
      <description>&lt;P&gt;Glad I could help!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 02:33:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/My-count-is-double-Can-I-use-field-from-search-to-search-lookup/m-p/311027#M93248</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-10-20T02:33:45Z</dc:date>
    </item>
  </channel>
</rss>

