<?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: Matching Two Strings in Field Extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84927#M21651</link>
    <description>&lt;P&gt;I'm not sure I follow. Why would you need multiple searches to perform multiple field extractions? There are usually loads of field extractions taking place for each event in a search.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2013 15:58:08 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2013-01-11T15:58:08Z</dc:date>
    <item>
      <title>Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84923#M21647</link>
      <description>&lt;P&gt;I am trying to match two separate strings for one field extraction. When setup separately they would look like...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)^[^*#\d+\s+(?P&amp;lt; a &amp;gt;[^]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)^(?:[^\-]*\i{2}\d+\s+(?P&amp;lt; b &amp;gt;[^]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I combined them by simply placing a pipe in between the two strings. The problem is Splunk will only pick up whichever value has a, and the b value will be lost. I can switch a and b and the values picked up will switch, but I cannot get the combination of both. I also cannot name both a as that is against Splunk conventions. Is this possible to accomplish? What am I missing here? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 14:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84923#M21647</guid>
      <dc:creator>kederart</dc:creator>
      <dc:date>2013-01-11T14:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84924#M21648</link>
      <description>&lt;P&gt;The only solution I've found so far is adding a second field extraction that both search on a. However, we have multiple logs and this could get cluttered when we start adding more searches. Would prefer to keep it as one search.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 14:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84924#M21648</guid>
      <dc:creator>kederart</dc:creator>
      <dc:date>2013-01-11T14:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84925#M21649</link>
      <description>&lt;P&gt;Why not have two field extractions?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:29:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84925#M21649</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-01-11T15:29:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84926#M21650</link>
      <description>&lt;P&gt;We have a dozen or so logs and we are doing multiple field extractions for each log. If we keep doing multiple field extraction for "a" then we are going to be cluttered with 6-10 searches per log. Our goal is to cut down on the clutter.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:53:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84926#M21650</guid>
      <dc:creator>kederart</dc:creator>
      <dc:date>2013-01-11T15:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84927#M21651</link>
      <description>&lt;P&gt;I'm not sure I follow. Why would you need multiple searches to perform multiple field extractions? There are usually loads of field extractions taking place for each event in a search.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 15:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84927#M21651</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-01-11T15:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84928#M21652</link>
      <description>&lt;P&gt;Sorry for the confusion. We want to search for a name (example a), however the name isn't always coming up as other names are being formatted in the second way (example b). We want a way to search for all the names without having multiple field extractions. I thought we could do that by piping the two searches together. We don't want to have name1, name2, name3 for field extractions because it's going to become cluttered and a little difficult to manage. Does that make more sense?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 16:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84928#M21652</guid>
      <dc:creator>kederart</dc:creator>
      <dc:date>2013-01-11T16:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84929#M21653</link>
      <description>&lt;P&gt;can you not change the regex to:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?i)^([^*#]\d+\s+|(?:)[^\-]*\i{2}\d+\s+)(?P&amp;lt;a&amp;gt;[^]+)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;this should match &lt;CODE&gt;(?P&amp;lt;a&amp;gt;[^]+)&lt;/CODE&gt;  when preceded by either &lt;CODE&gt;(?i)^[^*#]\d+\s+&lt;/CODE&gt; or &lt;CODE&gt;(?i)^(?:)[^\-]*\i{2}\d+\s+&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;that is assuming you are missing a closing &lt;CODE&gt;[&lt;/CODE&gt; and &lt;CODE&gt;)&lt;/CODE&gt; in the expressions in your question.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 17:30:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84929#M21653</guid>
      <dc:creator>jameshgibson</dc:creator>
      <dc:date>2013-01-11T17:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Matching Two Strings in Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84930#M21654</link>
      <description>&lt;P&gt;Fair enough, but I think the easiest thing still would be to have multiple field extractions - you can still use the same field name for your extraction, it's just different ways of arriving at the extracted field. So you wouldn't have to mess with name1, name2 etc, you can just extract everything to name.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2013 18:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Matching-Two-Strings-in-Field-Extraction/m-p/84930#M21654</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-01-11T18:54:14Z</dc:date>
    </item>
  </channel>
</rss>

