<?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 merge two fields together and get rid of what does not match? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407338#M117652</link>
    <description>&lt;P&gt;Before the where clause/command.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jul 2018 20:10:47 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-07-02T20:10:47Z</dc:date>
    <item>
      <title>How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407326#M117640</link>
      <description>&lt;P&gt;Hi. I have two sources that I am trying to merge and dedup similar data. They both have a license key, one was longer than the other but had the main 7 variables that I used substr to make them both the same. Currently the syntax looks like this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="LMCustomerRevLicense.csv" OR source="C:\\Users\\ragate\\Desktop\\splunk\\JsonDump.txt" Dykema | eval LicenseKeyID=substr('context.custom.dimensions{}.LicenseKey',4,7) | dedup "Account Name" | table "LicenseKeyID" "Account Name" "context.custom.dimensions{}.DocumentSessionId" | where "License Key Identifier"="LicenseKeyID"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to merge these two license keys together to then be able to have everything else in the csv file will be able to be sorted with this key and anything that does not match with the one I used substr for is removed from the data. This might seem a little confusing so let me know if I need to explain a little better. I am new to splunk if that hasn't been made obvious already.&lt;/P&gt;

&lt;P&gt;Thanks in advance. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 15:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407326#M117640</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-06-28T15:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407327#M117641</link>
      <description>&lt;P&gt;Like to clarify that Dykema is there only because I was using that company to try to see if it would work. Currently, this code does not produce anything for me. Just is the closest I can get. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 16:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407327#M117641</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-06-28T16:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407328#M117642</link>
      <description>&lt;P&gt;I'm confused by some of the things in your search. What do you get from this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="LMCustomerRevLicense.csv" OR source="C:\\Users\\ragate\\Desktop\\splunk\\JsonDump.txt"  
| dedup "Account Name" 
| eval LicenseKeyID=substr('context.custom.dimensions{}.LicenseKey',4,7) 
| table LicenseKeyID "Account Name" "context.custom.dimensions{}.DocumentSessionId"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do your results have the correct values in the table?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 20:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407328#M117642</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-28T20:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407329#M117643</link>
      <description>&lt;P&gt;No I do not get the correct values. The LicenseKeyID field is left blank. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 20:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407329#M117643</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-06-28T20:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407330#M117644</link>
      <description>&lt;P&gt;So your &lt;CODE&gt;eval&lt;/CODE&gt; is incorrect. What values are in &lt;CODE&gt;context.custom.dimensions{}.LicenseKey&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 20:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407330#M117644</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-28T20:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407331#M117645</link>
      <description>&lt;P&gt;Try This - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     source="LMCustomerRevLicense.csv" |  dedup "Account Name" | table  "License Key Identifier","Account Name", "context.custom.dimensions{}.DocumentSessionId" | join "License Key Identifier" [append search source="C:\\Users\\ragate\\Desktop\\splunk\\JsonDump.txt"|eval LicenseKeyID=substr('context.custom.dimensions{}.LicenseKey',4,7) | dedup "Account Name" | table  "License Key Identifier", "Account Name","context.custom.dimensions{}.DocumentSessionId"| rename LicenseKeyId as  "License Key Identifier"]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You are performing a straight dedup on "Account Name" ,is that present in both the sources? If not remove it from the table command where "Account Name" is not present from the above query&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 12:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407331#M117645</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-30T12:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407332#M117646</link>
      <description>&lt;P&gt;I believe that the heart of your problem is normalizing the license field.  You should probably not be using &lt;CODE&gt;substr&lt;/CODE&gt;; try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=license_field_name mode=sed "s/[^\-]\-// s/\-.*//"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will work on field values that need to be modified and will be harmless on those that don't.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 15:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407332#M117646</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T15:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407333#M117647</link>
      <description>&lt;P&gt;Currently have the License Field as: CC-301TJFQ-ST0-X-Q3332 &lt;/P&gt;

&lt;P&gt;I am not good with regex but the one you gave me gives me C301TJFQ &lt;/P&gt;

&lt;P&gt;I need it to be 301TJFQ&lt;/P&gt;

&lt;P&gt;Anyway you could help me with that?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 19:09:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407333#M117647</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-07-02T19:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407334#M117648</link>
      <description>&lt;P&gt;You're comparing two fields "License Key Identifier" and "LicenseKeyID". Do both exist in all the events (in other words, do both exist in both CSV and TXT file data?)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 19:52:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407334#M117648</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-02T19:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407335#M117649</link>
      <description>&lt;P&gt;Yes, In the LicenseKeyID I parsed out unnecessary digits to get the raw License Key Identifier. From there, both exist in the TXT and CSV.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 19:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407335#M117649</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-07-02T19:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407336#M117650</link>
      <description>&lt;P&gt;Try this (adding the plus sign)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=license_field_name mode=sed "s/[^\-]+\-// s/\-.*//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Jul 2018 19:59:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407336#M117650</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-02T19:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407337#M117651</link>
      <description>&lt;P&gt;Thank You, That worked. Where would be the correct places to add this into my original query?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 20:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407337#M117651</guid>
      <dc:creator>Ragate</dc:creator>
      <dc:date>2018-07-02T20:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407338#M117652</link>
      <description>&lt;P&gt;Before the where clause/command.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jul 2018 20:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407338#M117652</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-02T20:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I merge two fields together and get rid of what does not match?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407339#M117653</link>
      <description>&lt;P&gt;Be sure to click &lt;CODE&gt;Accept&lt;/CODE&gt; to close the question and let others find working answers, @Ragate.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jul 2018 16:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-merge-two-fields-together-and-get-rid-of-what-does-not/m-p/407339#M117653</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-07-05T16:32:13Z</dc:date>
    </item>
  </channel>
</rss>

