<?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: Matching key word in CSV with other data in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232555#M45372</link>
    <description>&lt;P&gt;If I'm understanding the question correctly, this should do what you're asking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup data.csv 
| join title type=left [|inputlookup keywords.csv | rename word as title | eval match="yes"]
| eval match=if(isnull(match),"no",match)
| table title description match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where data.csv contains:&lt;BR /&gt;
description,title&lt;BR /&gt;
"here is a description","title"&lt;/P&gt;

&lt;P&gt;and keywords.csv contains:&lt;BR /&gt;
word&lt;BR /&gt;
"some"&lt;BR /&gt;
"random"&lt;BR /&gt;
"title"&lt;BR /&gt;
"here"&lt;/P&gt;</description>
    <pubDate>Thu, 18 Aug 2016 17:50:55 GMT</pubDate>
    <dc:creator>pgrantham_splun</dc:creator>
    <dc:date>2016-08-18T17:50:55Z</dc:date>
    <item>
      <title>Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232553#M45370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have data in a CSV file which I am pulling in a search.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;|inputlookup data.csv&lt;/P&gt;

&lt;P&gt;description    title&lt;BR /&gt;
data here       some random title&lt;/P&gt;

&lt;P&gt;I have another CSV which contains key words such as:&lt;/P&gt;

&lt;P&gt;keywords.csv&lt;BR /&gt;
Word:&lt;BR /&gt;
data&lt;BR /&gt;
random&lt;BR /&gt;
title&lt;/P&gt;

&lt;P&gt;I want to basically match my data.csv with the keywords.csv and create a new column within the splunk search where the keyword matches.&lt;/P&gt;

&lt;P&gt;So the outcome should be:&lt;/P&gt;

&lt;P&gt;description   title                                       matches&lt;BR /&gt;
data here      some random title             yes&lt;BR /&gt;
test                 test2                                    no&lt;/P&gt;

&lt;P&gt;how can this be achieved?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 15:11:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232553#M45370</guid>
      <dc:creator>abbam</dc:creator>
      <dc:date>2016-08-18T15:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232554#M45371</link>
      <description>&lt;P&gt;You basically need to do wildcarded lookup between these two lookups. Have a look at these post on steps to implement the same&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;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/148245/how-to-create-automatic-wildcard-lookups-against-more-than-one-field-in-a-csv-file.html"&gt;https://answers.splunk.com/answers/148245/how-to-create-automatic-wildcard-lookups-against-more-than-one-field-in-a-csv-file.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 17:02:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232554#M45371</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-08-18T17:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232555#M45372</link>
      <description>&lt;P&gt;If I'm understanding the question correctly, this should do what you're asking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup data.csv 
| join title type=left [|inputlookup keywords.csv | rename word as title | eval match="yes"]
| eval match=if(isnull(match),"no",match)
| table title description match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where data.csv contains:&lt;BR /&gt;
description,title&lt;BR /&gt;
"here is a description","title"&lt;/P&gt;

&lt;P&gt;and keywords.csv contains:&lt;BR /&gt;
word&lt;BR /&gt;
"some"&lt;BR /&gt;
"random"&lt;BR /&gt;
"title"&lt;BR /&gt;
"here"&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2016 17:50:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232555#M45372</guid>
      <dc:creator>pgrantham_splun</dc:creator>
      <dc:date>2016-08-18T17:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232556#M45373</link>
      <description>&lt;P&gt;I've tried to do something similar but cannot seem to get it working.&lt;/P&gt;

&lt;P&gt;How do I reference the CSV as the source in the props.conf file?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 08:44:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232556#M45373</guid>
      <dc:creator>abbam</dc:creator>
      <dc:date>2016-08-19T08:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232557#M45374</link>
      <description>&lt;P&gt;Afraid that doesn't work.&lt;/P&gt;

&lt;P&gt;The keywords need to be wildcarded and it needs to be found within a sentence within the data.csv file.&lt;/P&gt;

&lt;P&gt;So data.csv includes this sentence:&lt;BR /&gt;
"this is random data"&lt;/P&gt;

&lt;P&gt;keyword.csv file:&lt;BR /&gt;
&lt;EM&gt;random&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;needs to find the match in the data.csv and output a new field saying that it's matched&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 08:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232557#M45374</guid>
      <dc:creator>abbam</dc:creator>
      <dc:date>2016-08-19T08:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Matching key word in CSV with other data</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232558#M45375</link>
      <description>&lt;P&gt;+1 +1 thank you so much! got this working.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2016 08:57:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Matching-key-word-in-CSV-with-other-data/m-p/232558#M45375</guid>
      <dc:creator>abbam</dc:creator>
      <dc:date>2016-08-19T08:57:55Z</dc:date>
    </item>
  </channel>
</rss>

