<?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 append the field by matching two different data source in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366780#M108197</link>
    <description>&lt;P&gt;Can you please help me to make this case insensitive&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2017 20:41:23 GMT</pubDate>
    <dc:creator>ninadbhaskarwar</dc:creator>
    <dc:date>2017-06-21T20:41:23Z</dc:date>
    <item>
      <title>How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366776#M108193</link>
      <description>&lt;P&gt;I have one Source =”ABC.csv” and a lookup “a_alert”.&lt;/P&gt;

&lt;P&gt;ABS.csv contains fields such as ID, Description (200 free character field)&lt;/P&gt;

&lt;P&gt;a_alert contain one field a_type e.g. Monitoring, Access, Deployment &lt;/P&gt;

&lt;P&gt;I need a query which can match Description from ABC.csv to a_type from a_alert and create the append a field in the ABC.csv&lt;BR /&gt;
Final output should be&lt;/P&gt;

&lt;P&gt;ID  Description                                                           a_type&lt;BR /&gt;
1   User having Access Issue                                      Access&lt;BR /&gt;
2   …. Monitoring …….                                           Monitoring&lt;BR /&gt;
3   … product having successful deployment      Deployment &lt;BR /&gt;
4   Access Issue with .. type of Users                    Access&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/207619-sample.jpg" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366776#M108193</guid>
      <dc:creator>ninadbhaskarwar</dc:creator>
      <dc:date>2020-09-29T14:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366777#M108194</link>
      <description>&lt;P&gt;Assuming the word in the lookup a_type (e.g. Access, Monitoring etc) contained in the Description field in your data from source=ABC.csv, you would need to setup a lookup table with wildcard.&lt;/P&gt;

&lt;P&gt;Everything on Search Head, will need to restart Splunk after config change.&lt;BR /&gt;
Step1: Update your lookup table a_alert to include wildcard characters.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a_type   ---this is the header
*Access*
*Monitoring*
*Deployment*
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Step2: (assuming lookup table a_alert.csv is already uploaded as lookup) Create a lookup transform with wild card mat&lt;BR /&gt;
transforms.conf on any app/local directory in $Splunk_home/etc/apps&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[alert_lookup]
 filename = a_alert.csv
 match_type = WILDCARD(a_type)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Step 2: add lookup command to your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search giving field ID Description
| lookup alert_lookup a_alert as Description OUTPUT a_type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Reference:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/52580/can-we-use-wildcard-characters-in-a-lookup-table.html" target="_blank"&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>Tue, 29 Sep 2020 14:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366777#M108194</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T14:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366778#M108195</link>
      <description>&lt;P&gt;You have a &lt;CODE&gt;source&lt;/CODE&gt; of &lt;CODE&gt;ABC.csv&lt;/CODE&gt; that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID (integer), Description (200 free character field)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You have a &lt;CODE&gt;lookup&lt;/CODE&gt; called &lt;CODE&gt;a_alert&lt;/CODE&gt; that contains one field like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a_type
Monitoring
Access
Deployment
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need a query which can match &lt;CODE&gt;Description&lt;/CODE&gt; from &lt;CODE&gt;ABC.csv&lt;/CODE&gt; to &lt;CODE&gt;a_type&lt;/CODE&gt; from &lt;CODE&gt;a_alert&lt;/CODE&gt; and create/append &lt;CODE&gt;a_field&lt;/CODE&gt; so that the final output is like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ID    a_type        Description
1     Access        User having Access Issue
2     Monitoring    …. Monitoring …….
3     Deployment    … product having successful deployment
4     Access        Access Issue with .. type of Users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need to change your &lt;CODE&gt;a_alert&lt;/CODE&gt; lookup to a &lt;CODE&gt;wildcard&lt;/CODE&gt; (and possibly &lt;CODE&gt;case_insensitive&lt;/CODE&gt;, if you'd like that, too); there is a special setting in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to enable this.  Then add bounding asterisks by doing this ONLY ONCE:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup a_alert | eval a_type = "*" . a_type . "*" | outputlookup a_alert
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;a_type
*Monitoring*
*Access*
*Deployment*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Finally, you do your search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv ABC.csv
| lookup a_alert a_type AS Description OUTPUT a_type
| rex field=a_type mode=sed "s/^\*// s/\*$//"
| table ID a_type Description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jun 2017 00:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366778#M108195</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-21T00:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366779#M108196</link>
      <description>&lt;P&gt;Both of above worked for me, only change I did for solution provided  by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt; i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search giving field ID Description
|lookup alert_lookup a_type as Description OUTPUT a_type 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;instead of a_alert I have used a_type which is given by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; .Also I have used regex from &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; &lt;/P&gt;

&lt;P&gt;Thanks to &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt; and &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/1406"&gt;@woodcock&lt;/a&gt; for providing quick solution&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:37:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366779#M108196</guid>
      <dc:creator>ninadbhaskarwar</dc:creator>
      <dc:date>2020-09-29T14:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366780#M108197</link>
      <description>&lt;P&gt;Can you please help me to make this case insensitive&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 20:41:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366780#M108197</guid>
      <dc:creator>ninadbhaskarwar</dc:creator>
      <dc:date>2017-06-21T20:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366781#M108198</link>
      <description>&lt;P&gt;Add this to your lookup definition in transforms.conf (under &lt;CODE&gt;[alert_lookup]&lt;/CODE&gt;)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;case_sensitive_match = false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Jun 2017 20:48:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366781#M108198</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-21T20:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to append the field by matching two different data source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366782#M108199</link>
      <description>&lt;P&gt;Thanks it worked&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 04:21:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-append-the-field-by-matching-two-different-data-source/m-p/366782#M108199</guid>
      <dc:creator>ninadbhaskarwar</dc:creator>
      <dc:date>2017-06-22T04:21:13Z</dc:date>
    </item>
  </channel>
</rss>

