<?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 search and extract the correct value from duplicate keys in an event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110748#M28966</link>
    <description>&lt;P&gt;Self-answer: use search time field extraction: (?i) ip="(?P&lt;REALIP&gt;[^"]+)" timestamp&lt;/REALIP&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Sep 2014 08:52:19 GMT</pubDate>
    <dc:creator>konrads</dc:creator>
    <dc:date>2014-09-04T08:52:19Z</dc:date>
    <item>
      <title>How to search and extract the correct value from duplicate keys in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110746#M28964</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have a lot of events indexed which contain the following line:&lt;BR /&gt;
    |ip="0.0.0.0" foo="bar" ip="174.34.166.10" timestamp="2014-08-18 06:30:33 UTC"&lt;/P&gt;

&lt;P&gt;The first "ip" value is "wrong" value and the second should be used only.  How do I search/extract the second ip value and discard the first?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110746#M28964</guid>
      <dc:creator>konrads</dc:creator>
      <dc:date>2014-09-04T08:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and extract the correct value from duplicate keys in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110747#M28965</link>
      <description>&lt;P&gt;Assuming your "0.0.0.0" is that "wrong" value you want to avoid (and that's not just a placeholder you put in here), why not try using a regex to match IP addresses that aren't 0.0.0.0? &lt;/P&gt;

&lt;P&gt;Even if 0.0.0.0 isn't actually the value that you're trying to avoid, a regex could probably help you extract the second address, anyway. &lt;/P&gt;

&lt;P&gt;The docs for spunk's regex function even include a couple of ip-address matching examples you might be able to adapt: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/regex"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/SearchReference/regex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110747#M28965</guid>
      <dc:creator>petecooper</dc:creator>
      <dc:date>2014-09-04T08:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and extract the correct value from duplicate keys in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110748#M28966</link>
      <description>&lt;P&gt;Self-answer: use search time field extraction: (?i) ip="(?P&lt;REALIP&gt;[^"]+)" timestamp&lt;/REALIP&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:52:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110748#M28966</guid>
      <dc:creator>konrads</dc:creator>
      <dc:date>2014-09-04T08:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and extract the correct value from duplicate keys in an event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110749#M28967</link>
      <description>&lt;P&gt;if I'd do that, then where I have ip="0.0.0.0" ... ip="1.2.3.4" lines won't match at all. Field extraction was the way to go, but thanks for your suggestion.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2014 08:53:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-extract-the-correct-value-from-duplicate-keys/m-p/110749#M28967</guid>
      <dc:creator>konrads</dc:creator>
      <dc:date>2014-09-04T08:53:28Z</dc:date>
    </item>
  </channel>
</rss>

