<?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 do I use a csv to identify search terms and correlate events with metadata? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246409#M73460</link>
    <description>&lt;P&gt;Yes you have to extract the fields to match against lookup. &lt;BR /&gt;
If not you have to change the lookup table with wildcards and enable wildcard match. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;My lookup table contains now name with wildcard&lt;/P&gt;

&lt;P&gt;(name,benefit,type&lt;BR /&gt;
&lt;EM&gt;banana&lt;/EM&gt;,5,fruit&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Added match-type to transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [food]
filename = food
match_type = WILDCARD(name)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Created dummy event with name inside text and is working&lt;/P&gt;

&lt;P&gt;| stats count | eval name = "This is my banana" | lookup food name&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Its preferred to extract the filed and match against lookup instead of this wildcard for accuracy&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jan 2016 02:50:56 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2016-01-28T02:50:56Z</dc:date>
    <item>
      <title>How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246402#M73453</link>
      <description>&lt;P&gt;I have an index of log data I am trying to search.  &lt;/P&gt;

&lt;P&gt;I have a seperate csv file containing a list of about 40 search terms with two metadata for each term:&lt;/P&gt;

&lt;P&gt;name,benefit,type&lt;BR /&gt;
banana,5,fruit&lt;BR /&gt;
ice cream,1,desert&lt;BR /&gt;
tomato,3,vegetable&lt;/P&gt;

&lt;P&gt;I want to then create a dashboard that can peruse through the events with those terms and the corresponding metadata.  &lt;/P&gt;

&lt;P&gt;Is this feasible?  I imagine I could use 40 individual eval functions but I would like to save time by using the csv file.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2016 02:29:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246402#M73453</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-23T02:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246403#M73454</link>
      <description>&lt;P&gt;&lt;CODE&gt;lookup&lt;/CODE&gt; is the first option you should try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eg : &amp;lt;your search terms from the index&amp;gt; |lookup &amp;lt;lookupname&amp;gt; name OUTPUT type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer here for more info : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/lookup"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/lookup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jan 2016 11:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246403#M73454</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-23T11:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246404#M73455</link>
      <description>&lt;P&gt;I have an index I am trying to search.  &lt;/P&gt;

&lt;P&gt;I have a seperate csv file containing a list of about 40 search terms with two metadata for each term:&lt;/P&gt;

&lt;P&gt;name,benefit,type&lt;BR /&gt;
banana,5,fruit&lt;BR /&gt;
ice cream,1,desert&lt;BR /&gt;
tomato,3,vegetable&lt;/P&gt;

&lt;P&gt;I want to then create a table with just the events with those names and the corresponding metadata.  &lt;/P&gt;

&lt;P&gt;Is this feasible?  I imagine I could use 40 individual eval functions but I would like to save time by using the csv file.&lt;/P&gt;

&lt;P&gt;When I attempt to implement the syntax:&lt;/P&gt;

&lt;P&gt;host=coolstuff | lookup food name OUTPUT type| table text, type&lt;/P&gt;

&lt;P&gt;I was hoping to get a table containing text with the particular food called out along with the corresponding type from the lookup file.  Instead, when I ran the search, my search returns ALL the events (not just those with the food name) and then the statistics tab returns (0) - there is no table with just text or type.&lt;/P&gt;

&lt;P&gt;Can you help me troubleshoot where I went wrong?&lt;/P&gt;

&lt;P&gt;I've tried mixing up the syntax to get the results I want, but am just drawing a complete blank as to how to use this command.  &lt;/P&gt;

&lt;P&gt;host=coolstuff | input food name (AS text) OUTPUT type | table text, type&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 00:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246404#M73455</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-24T00:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246405#M73456</link>
      <description>&lt;P&gt;Is &lt;EM&gt;food&lt;/EM&gt; your csv name or lookupname? what fields you are getting out of your index search ? &lt;/P&gt;

&lt;P&gt;If you have a field &lt;EM&gt;name&lt;/EM&gt; in your search result, you can use that lookup in your csv  file and pick up the respective benefit and type from it.&lt;/P&gt;

&lt;P&gt;See here : &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Addfieldsfromexternaldatasources#CSV_lookup_example"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Addfieldsfromexternaldatasources#CSV_lookup_example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2016 03:43:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246405#M73456</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-24T03:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246406#M73457</link>
      <description>&lt;P&gt;Thank you Renjith,&lt;/P&gt;

&lt;P&gt;I bet the answer is pretty simple.  I just am having some difficulty here.  The pages you referred me to are quite informative.  I am grateful for your assistance.&lt;/P&gt;

&lt;P&gt;"food.csv" is the csv name as well as the lookup table name I uploaded into &lt;/P&gt;

&lt;P&gt;.../manager/search/data/lookup-table-files&lt;/P&gt;

&lt;P&gt;and the Lookup definition I created in &lt;/P&gt;

&lt;P&gt;.../manager/search/data/transforms/lookups&lt;/P&gt;

&lt;P&gt;I then followed the instructions found here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Usefieldlookupstoaddinformationtoyourevents"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Usefieldlookupstoaddinformationtoyourevents&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;to make my lookup automatic.&lt;/P&gt;

&lt;P&gt;Unfortunately, the fields I requested do not show up in the side bar.  Nor does the field "name" appear there.  I was hoping that the names from my csv would search all fields and return the corresponding results from the other columns.  The field text is there though. &lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2016 20:13:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246406#M73457</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-26T20:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246407#M73458</link>
      <description>&lt;P&gt;Ok let me explain what I have done.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;I created lookup file called food.csv with below values &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;name,benefit,type
banana,5,fruit
ice cream,1,desert
tomato,3,vegetable
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Uploaded the look up file using  &lt;CODE&gt;Settings &amp;gt;&amp;gt;Lookups » Lookup table files&lt;/CODE&gt; and set permissions&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Created a lookup definition &lt;STRONG&gt;food&lt;/STRONG&gt; and selected type as &lt;STRONG&gt;File based&lt;/STRONG&gt; and the lookup file as &lt;STRONG&gt;food&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Tested my lookup by just executing &lt;CODE&gt;|inputlookup food&lt;/CODE&gt; in my search window and data is visible&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Created dummy event with &lt;STRONG&gt;name&lt;/STRONG&gt; filed as "banana" to test and did a lookup against &lt;STRONG&gt;food&lt;/STRONG&gt; and all my related fields (benefit and type) are displaying&lt;/P&gt;

&lt;P&gt;|stats count|eval name="banana"|lookup food name|table name benefit type&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Let me know in which step you are facing issue&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 04:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246407#M73458</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-27T04:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246408#M73459</link>
      <description>&lt;P&gt;Step four.  Unfortunatley, my food "names" are hidden in text.  Do I need to do a rex command to create fields?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 21:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246408#M73459</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-27T21:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246409#M73460</link>
      <description>&lt;P&gt;Yes you have to extract the fields to match against lookup. &lt;BR /&gt;
If not you have to change the lookup table with wildcards and enable wildcard match. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;My lookup table contains now name with wildcard&lt;/P&gt;

&lt;P&gt;(name,benefit,type&lt;BR /&gt;
&lt;EM&gt;banana&lt;/EM&gt;,5,fruit&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Added match-type to transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [food]
filename = food
match_type = WILDCARD(name)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Created dummy event with name inside text and is working&lt;/P&gt;

&lt;P&gt;| stats count | eval name = "This is my banana" | lookup food name&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Its preferred to extract the filed and match against lookup instead of this wildcard for accuracy&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 02:50:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246409#M73460</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-28T02:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246410#M73461</link>
      <description>&lt;P&gt;Thank you so much for your patient instruction!  I just updated my lookup table to look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  name,benefit,type
 *banana*,5,fruit
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and then I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats count | eval name="i want bananas" | lookup food name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and it returned four columns, two of them containing values:&lt;/P&gt;

&lt;P&gt;count benefit type name&lt;BR /&gt;
0                               "i want bananas"&lt;/P&gt;

&lt;P&gt;So, something is working!  I couldn't even get the columns to show up before...&lt;/P&gt;

&lt;P&gt;Perhaps it is because I do not know how to change transforms.conf&lt;/P&gt;

&lt;P&gt;On this page: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Usefieldlookupstoaddinformationtoyourevents"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Knowledge/Usefieldlookupstoaddinformationtoyourevents&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It said that:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Use the Settings &amp;gt; Lookups &amp;gt; Lookup definitions page to define the lookup table or edit existing lookup definitions. You can specify the type of lookup (file-based or external) and whether or not it is time-based. Once you've defined the lookup table, you can invoke the lookup in a search (using the lookup command) or you can configure the lookup to occur automatically.      Note: This is equivalent to defining your lookup in transforms.conf.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;On the Settings&amp;gt;Lookups&amp;gt;Lookup definitions page, I could not find a way to mimic "match_type=WILDCARD(name)"&lt;/P&gt;

&lt;P&gt;Is there a way to do that without editing transforms.conf?  If not, how would I edit transforms.conf?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 20:56:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246410#M73461</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-29T20:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246411#M73462</link>
      <description>&lt;P&gt;Ok.  Thank you.  I will try this out and let you know how it goes.  &lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 00:43:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246411#M73462</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-30T00:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246412#M73463</link>
      <description>&lt;P&gt;No problem. Just edit your transforms.conf  for the lookup on disk. If you have created this lookup in search app, and not shared (private) &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Location : SPLUNK_HOME/etc/users//search/local&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If it's shared in app then,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Location : SPLUNK_HOME/etc/apps/search/local/&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You will be able to see your food stanza in the transforms.conf . Just add the macth_type parameter under that&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 03:00:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246412#M73463</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2016-01-30T03:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a csv to identify search terms and correlate events with metadata?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246413#M73464</link>
      <description>&lt;P&gt;NICE!!&lt;/P&gt;

&lt;P&gt;It worked!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 06:03:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-csv-to-identify-search-terms-and-correlate-events/m-p/246413#M73464</guid>
      <dc:creator>Phil219</dc:creator>
      <dc:date>2016-01-30T06:03:35Z</dc:date>
    </item>
  </channel>
</rss>

