<?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 compare 2 values from 1 field in different events and use match or like commands in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295683#M89213</link>
    <description>&lt;P&gt;The sourcetype is the same and please take at the samples above and provide your inputs.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2017 13:59:35 GMT</pubDate>
    <dc:creator>rahul_jasrotia</dc:creator>
    <dc:date>2017-08-21T13:59:35Z</dc:date>
    <item>
      <title>How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295676#M89206</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I have a field say hostname with some values like AAB89786 and AAB89786W in different events. Basically they're the same values but with an extra character, so it can be anything and not just W like mentioned above. &lt;BR /&gt;
Now i want to compare these 2 values and prevent them from going to the next search as they're the same and not 2 different hostnames. Any clues on how can we do this ?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 07:27:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295676#M89206</guid>
      <dc:creator>rahul_jasrotia</dc:creator>
      <dc:date>2017-08-21T07:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295677#M89207</link>
      <description>&lt;P&gt;any chance of putting some sample events?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 08:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295677#M89207</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2017-08-21T08:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295678#M89208</link>
      <description>&lt;P&gt;Please find the sample below, have masked the ip and mac address .&lt;BR /&gt;
Now the hostnames under () i.e AAB89786W  and AAB89786 are the same but Splunk is treating them differently and  I need to solve this thing.&lt;/P&gt;

&lt;P&gt;&amp;lt;30&amp;gt;Jul 19 08:38:34 xxxx057-3dc-xxxxx.net.xxxx.com dhcpd[22174]: DHCPACK on 1d.xx.33.181 to e4:a4:71:24:xx:6d (AAB89786W ) via eth2 relay 10.dd.dd.pp lease-duration 43200 (RENEW) uid xx:00:xx:5d:21:1f:xx&lt;BR /&gt;
&amp;lt;30&amp;gt;Jul 19 08:22:06 xxxx059-3dc-xxxxxx.net.xxxx.com dhcpd[11241]: DHCPACK on 1d.xx.xx.231 to 08:xx:41:e6:cb:xx (Treo-xxx) via eth2 relay 10.cc.mm.1 lease-duration 432000 (RENEW) uid 01:08:xx:41:e6:xx&lt;BR /&gt;
&amp;lt;30&amp;gt;Jul 19 08:15:17 nl00059-3dc-nsdhcp02.net.xxxx.com dhcpd[11241]: DHCPACK on 1d.56.xx.xxx to 08:6d:xx:e6:xx(idb25) via eth2 relay 1x.56.xx.1 lease-duration 3600 (RENEW) uid zz:08:6d:xx:e6:cb:a1&lt;BR /&gt;
&amp;lt;30&amp;gt;Jul 19 08:02:28 nl00059-3dc-nsdhcp02.net.xxxx.com dhcpd[11241]: DHCPACK on 10.29.33.3 to e4:xx:71:xx:b4:6d (AAB89786W) via eth2 relay 1x.29.xx.12 lease-duration 3600 uid 01:xx:a4:xx:24:xx:6d&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 08:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295678#M89208</guid>
      <dc:creator>rahul_jasrotia</dc:creator>
      <dc:date>2017-08-21T08:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295679#M89209</link>
      <description>&lt;P&gt;If you know the format, you can convert hostname.&lt;/P&gt;

&lt;P&gt;EX.) ---Convert with sourcetype&lt;BR /&gt;
    (your search)&lt;BR /&gt;
    |eval hostname=case(sourcetype == "A",substr(hostname,1,10),sourcetype == "B",substr(hostname,2,10),hostname)&lt;BR /&gt;
    |stats count by hostname&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 09:27:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295679#M89209</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-08-21T09:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295680#M89210</link>
      <description>&lt;P&gt;the sample hasn't come out well, request you to please treat as a new event whenever you find a timestamp.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 11:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295680#M89210</guid>
      <dc:creator>rahul_jasrotia</dc:creator>
      <dc:date>2017-08-21T11:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295681#M89211</link>
      <description>&lt;P&gt;@rahul_jasrotia, you can post the Events using the code button here i.e. 101010 to make sure data does not get escaped.&lt;/P&gt;

&lt;P&gt;Is the length for field value constant? Is there only one additional character in the other event or can they be more?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 12:05:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295681#M89211</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-21T12:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295682#M89212</link>
      <description>&lt;P&gt;1.No the length is not constant &lt;BR /&gt;
2. Yes only 1 character is appended in the end.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 13:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295682#M89212</guid>
      <dc:creator>rahul_jasrotia</dc:creator>
      <dc:date>2017-08-21T13:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295683#M89213</link>
      <description>&lt;P&gt;The sourcetype is the same and please take at the samples above and provide your inputs.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 13:59:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295683#M89213</guid>
      <dc:creator>rahul_jasrotia</dc:creator>
      <dc:date>2017-08-21T13:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295684#M89214</link>
      <description>&lt;P&gt;I do not know the condition in this sample.&lt;BR /&gt;
Please fill in XXXX yourself.&lt;/P&gt;

&lt;P&gt;(your search)&lt;BR /&gt;
|eval hostname=if(XXXX,substr(hostname,1,len(hostname)-1),hostname)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 14:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295684#M89214</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2017-08-21T14:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from 1 field in different events and use match or like commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295685#M89215</link>
      <description>&lt;P&gt;I see the following 4 events in your example, if I filter each event with timestamp. However, two out of the 4 events provided have the host field your are interested in, and both are AAB89786W. As per your question they should be &lt;CODE&gt;AAB89786 and AAB89786W&lt;/CODE&gt;.  Are your sure you have not missed any other required event? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jul 19 08:38:34 xxxx057-3dc-xxxxx.net.xxxx.com dhcpd[22174]: DHCPACK on 1d.xx.33.181 to e4:a4:71:24:xx:6d (AAB89786W ) via eth2 relay 10.dd.dd.pp lease-duration 43200 (RENEW) uid xx:00:xx:5d:21:1f:xx 

Jul 19 08:22:06 xxxx059-3dc-xxxxxx.net.xxxx.com dhcpd[11241]: DHCPACK on 1d.xx.xx.231 to 08:xx:41:e6:cb:xx (Treo-xxx) via eth2 relay 10.cc.mm.1 lease-duration 432000 (RENEW) uid 01:08:xx:41:e6:xx 

Jul 19 08:15:17 nl00059-3dc-nsdhcp02.net.xxxx.com dhcpd[11241]: DHCPACK on 1d.56.xx.xxx to 08:6d:xx:e6:xx(idb25) via eth2 relay 1x.56.xx.1 lease-duration 3600 (RENEW) uid zz:08:6d:xx:e6:cb:a1 

Jul 19 08:02:28 nl00059-3dc-nsdhcp02.net.xxxx.com dhcpd[11241]: DHCPACK on 10.29.33.3 to e4:xx:71:xx:b4:6d (AAB89786W) via eth2 relay 1x.29.xx.12 lease-duration 3600 uid 01:xx:a4:xx:24:xx:6d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It would be easier for us to assist if you just provide the two events where AAB89786W and AAB89786 are present. So that we do not confuse them with unwanted sample.&lt;BR /&gt;
Kindly make sure you post events using the &lt;CODE&gt;code button (101010)&lt;/CODE&gt; on Splunk Answers.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 17:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-2-values-from-1-field-in-different-events-and-use/m-p/295685#M89215</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-21T17:05:23Z</dc:date>
    </item>
  </channel>
</rss>

