<?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: Combining 2 RE into single RE in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290317#M175686</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Ran the above search and fusxpowtc1.eth-s4p1 displayed under host field where as the fileds h1 and h2 are empty.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2017 07:34:55 GMT</pubDate>
    <dc:creator>muralisushma7</dc:creator>
    <dc:date>2017-02-10T07:34:55Z</dc:date>
    <item>
      <title>Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290312#M175681</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;For every event in the SPLUNK, I have set the RE for host field. In general all the input to Splunk is of the form: rdnglagos010-1-1.Fa0-1.ncr.com, hence I set the RE as (?\w+-\d+-\d.+) while indexing the data. Now, apart from this, I also have input of the form: fusxpowtc1.eth-s4p1, hence I set the RE as (?\w+..+). When I combine them as (?\w+-\d+-\d.+)| (?\w+..+), I get the correct output for fuspowtc1.eth-s4p1 but for other one it displays as 1.ncr.com. &lt;/P&gt;

&lt;P&gt;Can someone help me in writing a single RE such that host field should display correct output.&lt;/P&gt;

&lt;P&gt;Let me know if you need any more information.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2017 09:22:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290312#M175681</guid>
      <dc:creator>muralisushma7</dc:creator>
      <dc:date>2017-02-08T09:22:24Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290313#M175682</link>
      <description>&lt;P&gt;This works for me in regex101.com&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;h1&amp;gt;\w+-\d+-\d.+)|(?&amp;lt;h2&amp;gt;\w+\..+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Feb 2017 13:25:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290313#M175682</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-08T13:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290314#M175683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Still it is not working for me. I executed the RE that you gave.&lt;/P&gt;

&lt;P&gt;It displays the output as rdnglagos010-1-1.Fa0-1.ncr.com in the host field which is correct but for the other one it displays the VM name in the host field rather than fusxpowtc1.eth-s4p1.&lt;/P&gt;

&lt;P&gt;What can I do?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 07:42:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290314#M175683</guid>
      <dc:creator>muralisushma7</dc:creator>
      <dc:date>2017-02-09T07:42:09Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290315#M175684</link>
      <description>&lt;P&gt;Try this run-anywhere search.  Field h2 should match the second host name.  If it does not then there is something wrong in your search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 2 | eval host="fusxpowtc1.eth-s4p1" | rex field=host "(?&amp;lt;h1&amp;gt;\w+-\d+-\d.+)|(?&amp;lt;h2&amp;gt;\w+\..+)" | table host h1 h2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2017 13:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290315#M175684</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-09T13:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290316#M175685</link>
      <description>&lt;P&gt;You're trying to extract these fields from raw data or any other field? Can we have some sample entries? DIfferent regex is required for both the cases.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 14:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290316#M175685</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-09T14:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290317#M175686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Ran the above search and fusxpowtc1.eth-s4p1 displayed under host field where as the fileds h1 and h2 are empty.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 07:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290317#M175686</guid>
      <dc:creator>muralisushma7</dc:creator>
      <dc:date>2017-02-10T07:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290318#M175687</link>
      <description>&lt;P&gt;Hi somesoni2,&lt;/P&gt;

&lt;P&gt;I am trying to extract these fields from raw data itself. &lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Sushma.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 07:36:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290318#M175687</guid>
      <dc:creator>muralisushma7</dc:creator>
      <dc:date>2017-02-10T07:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290319#M175688</link>
      <description>&lt;P&gt;You would need to setup a boundary of some sort so that combined regex works. Can you post a sample event for each type of host format? Scrub any sensitive data before posting.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 15:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290319#M175688</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-10T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290320#M175689</link>
      <description>&lt;P&gt;What version of Splunk are you using?  Please copy-and-paste your search as code so we can see it.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 15:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290320#M175689</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-02-10T15:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Combining 2 RE into single RE</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290321#M175690</link>
      <description>&lt;P&gt;We really need a more complete example of the _raw to help you work this out.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 18:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combining-2-RE-into-single-RE/m-p/290321#M175690</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-10T18:23:27Z</dc:date>
    </item>
  </channel>
</rss>

