<?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: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422889#M121407</link>
    <description>&lt;P&gt;I've tried using this before hand, &lt;/P&gt;

&lt;P&gt;Lets say my lookup = newlookup.csv&lt;BR /&gt;
and contains the fields below : &lt;BR /&gt;
- new &lt;BR /&gt;
- Mac&lt;/P&gt;

&lt;P&gt;I've added under advanced options =&lt;BR /&gt;&lt;BR /&gt;
- WILCARD(new), WILDCARD(Mac)&lt;/P&gt;

&lt;P&gt;Would this be the syntax? for lookup&lt;BR /&gt;
index=data&lt;BR /&gt;
[ |lookup newlookup.csv new OUTPUT Mac]&lt;/P&gt;</description>
    <pubDate>Thu, 11 Oct 2018 04:10:50 GMT</pubDate>
    <dc:creator>Sp3ctre11</dc:creator>
    <dc:date>2018-10-11T04:10:50Z</dc:date>
    <item>
      <title>How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422886#M121404</link>
      <description>&lt;P&gt;So we have a lookup and an index : &lt;/P&gt;

&lt;P&gt;We need to correlate the prefix from the lookup with the data from the index, if it matches add a count of 1. &lt;/P&gt;

&lt;P&gt;An example : &lt;/P&gt;

&lt;P&gt;Prefix in the lookup is =    0d34&lt;/P&gt;

&lt;P&gt;the index may contain = 0d34ds3fdsf     &lt;/P&gt;

&lt;P&gt;We will need to check all the results in the index and see if it matches with any of the prefix in the lookup and then add a count of 1 next to it / else keep going and check other values until match is found. &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 02:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422886#M121404</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-11T02:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422887#M121405</link>
      <description>&lt;P&gt;You can use wild card in lookup.&lt;BR /&gt;
Please refer to this answer.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html"&gt;https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 03:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422887#M121405</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-10-11T03:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422888#M121406</link>
      <description>&lt;P&gt;I've already been looking at this case. Not quite sure on how to accomplish this, i've edited the lookup file with  WILDCARD=field ? &lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 04:04:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422888#M121406</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-11T04:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422889#M121407</link>
      <description>&lt;P&gt;I've tried using this before hand, &lt;/P&gt;

&lt;P&gt;Lets say my lookup = newlookup.csv&lt;BR /&gt;
and contains the fields below : &lt;BR /&gt;
- new &lt;BR /&gt;
- Mac&lt;/P&gt;

&lt;P&gt;I've added under advanced options =&lt;BR /&gt;&lt;BR /&gt;
- WILCARD(new), WILDCARD(Mac)&lt;/P&gt;

&lt;P&gt;Would this be the syntax? for lookup&lt;BR /&gt;
index=data&lt;BR /&gt;
[ |lookup newlookup.csv new OUTPUT Mac]&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 04:10:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422889#M121407</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-11T04:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422890#M121408</link>
      <description>&lt;P&gt;This is set in the configuration file（transforms.conf:）. It can not be set from the GUI.&lt;/P&gt;

&lt;P&gt;[newlookup]&lt;BR /&gt;
 filename = newlookup.csv&lt;BR /&gt;
 match_type = WILDCARD(new)&lt;/P&gt;

&lt;P&gt;newlookup.csv&lt;BR /&gt;
new,Mac&lt;BR /&gt;
0d34*,XXXXXXXXXXXXXXXXXXXXXXX&lt;/P&gt;

&lt;P&gt;---search---&lt;BR /&gt;
index=data&lt;BR /&gt;
| lookup newlookup.csv new OUTPUT Mac&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 04:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422890#M121408</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-10-11T04:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422891#M121409</link>
      <description>&lt;P&gt;Create a lookup file &lt;CODE&gt;newlookup.csv&lt;/CODE&gt; that contains fields and data like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;new,Mac
YourOutputValueHere,0d34*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note the asterisk appended to the &lt;CODE&gt;Mac&lt;/CODE&gt; value(s)!&lt;BR /&gt;
Next create a lookup definition &lt;CODE&gt;newlookup&lt;/CODE&gt; that points to this file and add the &lt;CODE&gt;WILDCARD(Mac)&lt;/CODE&gt; setting.&lt;/P&gt;

&lt;P&gt;Now use it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data | lookup newlookup new | table new Mac
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;NOTE that we are NOT using &lt;CODE&gt;newlookup.csv&lt;/CODE&gt; because that would point to the file and skip the definition where the &lt;CODE&gt;WILDCARD&lt;/CODE&gt; is.  You must use &lt;CODE&gt;newlookup&lt;/CODE&gt; and it will work fine.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 15:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422891#M121409</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-10-11T15:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422892#M121410</link>
      <description>&lt;P&gt;Evidently you need to use this as a filter on data, not a &lt;CODE&gt;loookup&lt;/CODE&gt; so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data [|inputlookup newlookup.csv | eval new = new . "*" | rename new AS Mac | table Mac ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that the fields in the &lt;CODE&gt;data&lt;/CODE&gt; are named &lt;CODE&gt;Mac&lt;/CODE&gt; and that the field with the prefix data in the lookup is named &lt;CODE&gt;new&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2018 22:59:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422892#M121410</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-10-11T22:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to match two columns based on prefix  (Numbers/Letters) and do a loop through each result</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422893#M121411</link>
      <description>&lt;P&gt;unfortuantly, we are still yet to figure this out. These answers are not achieving our goal as of yet.. &lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 03:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-match-two-columns-based-on-prefix-Numbers-Letters-and-do/m-p/422893#M121411</guid>
      <dc:creator>Sp3ctre11</dc:creator>
      <dc:date>2018-10-15T03:49:16Z</dc:date>
    </item>
  </channel>
</rss>

