<?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: Help with a search for barcodes based by group? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614378#M213499</link>
    <description>&lt;P&gt;Thank you for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Both results returned different amounts. Option 1 returned about 20 results while Option 2 returned roughly 4 results.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2022 19:33:52 GMT</pubDate>
    <dc:creator>KayBeesKnees83</dc:creator>
    <dc:date>2022-09-23T19:33:52Z</dc:date>
    <item>
      <title>Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614189#M213436</link>
      <description>&lt;P&gt;I have a customer that would like to use Splunk to search for a set of devices by their respective barcodes.&lt;/P&gt;
&lt;P&gt;The devices (barcodes) will come from an external list that will be placed in a separate index. For this scenario, the separate index will be referred to as "index 2". Additionally, the barcodes from the external list (which reside in index 2) will need to be matched to their respective organizations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These organizations reside in a separate index. For this scenario, the separate index (where the organization resides) will be referred to as "index 1".&lt;/P&gt;
&lt;P&gt;In a nutshell, the customer would like to compare the list of barcodes in index 2 and compare it to index 1 and see if they match any organizations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, if the a barcode (index 2) matches an organization (index 1), the customer would like to list all information associated with the barcode (i.e. hostname, serial number, organization name, etc.) that matched the organization.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advanced for your help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 18:21:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614189#M213436</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-22T18:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614221#M213444</link>
      <description>&lt;P&gt;This is a well-written use case. &amp;nbsp;These specifics greatly help others to contribute. &amp;nbsp;The general idea is to put both indexed data sources together and discern which ones contain both sources, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN (index1, index2) 
    [| tstats values(barcode) as barcode where index = index2]
| stats latest(hostname) as hostname latest(serial_number) as serial_number latest(organization_name) as organization_name latest(etc) as etc by barcode
| eval matched = if(isnull(organization), "no", "yes")&lt;/LI-CODE&gt;&lt;P&gt;(The subsearch can improve performance if index1 contains significantly more bar codes than index2; you can reverse it to "where index=index1" if the opposite is true, or drop the subsearch if the two indices contain about the same number of bar codes.)&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 23:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614221#M213444</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-22T23:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614311#M213463</link>
      <description>&lt;P&gt;Thank you for your reply. I sincerely appreciate your response. I had a question about the following:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;latest(etc) as etc by barcode&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the "etc" argument/field?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 13:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614311#M213463</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-23T13:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614336#M213478</link>
      <description>&lt;P&gt;My apologies on the "etc" post - I figured out that the "etc" represents the additional fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:08:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614336#M213478</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-23T15:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614366#M213488</link>
      <description>&lt;PRE&gt;| eval matched = if(isnull(organization), "no", "yes")&lt;/PRE&gt;&lt;P&gt;Which field should be listed as "organization"?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614366#M213488</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-23T18:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614368#M213490</link>
      <description>&lt;P&gt;"organization" was my spelling mistake. &amp;nbsp;Should be organization_name in accordance to the preceding code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN (index1, index2) 
    [| tstats values(barcode) as barcode where index = index2]
| stats latest(hostname) as hostname latest(serial_number) as serial_number latest(organization_name) as organization_name latest(etc) as etc by barcode
| eval matched = if(isnull(organization_name), "no", "yes")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:32:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614368#M213490</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-23T18:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614370#M213492</link>
      <description>&lt;P&gt;Unfortunately, only one event returns with "no" adjacent to the matched column. Furthermore,&amp;nbsp; the other columns do not fully populate with results.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 18:46:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614370#M213492</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-23T18:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614373#M213495</link>
      <description>&lt;P&gt;Here are 2 very simple way to do it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index1 [search index2 | dedup barcode | table barcode]
| stats latest(*) AS * by barcode&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;index IN (index1, index2)
| stats latest(*) AS * values(index) AS index_list dc(index) AS index_ct BY barcode
| eval matched=IF(index_ct=2, "Y", "N")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 19:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614373#M213495</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-09-23T19:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614378#M213499</link>
      <description>&lt;P&gt;Thank you for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Both results returned different amounts. Option 1 returned about 20 results while Option 2 returned roughly 4 results.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 19:33:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614378#M213499</guid>
      <dc:creator>KayBeesKnees83</dc:creator>
      <dc:date>2022-09-23T19:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help with a search for barcodes based by group?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614379#M213500</link>
      <description>&lt;P&gt;Option 2 gives you a bit more flexibility if you want to see both matched and not matched records (e.g, filter on the field "matched" and "index_list")&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 19:37:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-a-search-for-barcodes-based-by-group/m-p/614379#M213500</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-09-23T19:37:52Z</dc:date>
    </item>
  </channel>
</rss>

