<?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: Need help with regex in transforms.conf to find two words in an event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292135#M88250</link>
    <description>&lt;P&gt;would be helpful if you can share full event.&lt;BR /&gt;
also try and use regexr or regex101&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2017 12:54:32 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2017-03-23T12:54:32Z</dc:date>
    <item>
      <title>Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292134#M88249</link>
      <description>&lt;P&gt;Hallo,&lt;BR /&gt;
i have to filter the following literals in an event and i am new in regex:&lt;/P&gt;

&lt;P&gt;user:info &lt;BR /&gt;
ifconfig&lt;/P&gt;

&lt;P&gt;both literals must be in that event.&lt;/P&gt;

&lt;P&gt;this don't works:&lt;BR /&gt;
^.&lt;EM&gt;?\buser:info\b.&lt;/EM&gt;?\bifconfig\b.*?$&lt;/P&gt;

&lt;P&gt;Thank you for helping&lt;BR /&gt;
Gerd&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 07:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292134#M88249</guid>
      <dc:creator>gerdhuber</dc:creator>
      <dc:date>2017-03-23T07:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292135#M88250</link>
      <description>&lt;P&gt;would be helpful if you can share full event.&lt;BR /&gt;
also try and use regexr or regex101&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 12:54:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292135#M88250</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-03-23T12:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292136#M88251</link>
      <description>&lt;P&gt;When you post code, be sure to highlight the code and press the "code" button - it looks like 101 010.  That will keep the interface from treating the characters in the code as html or formatting commands.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:42:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292136#M88251</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-23T13:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292137#M88252</link>
      <description>&lt;P&gt;If you are coding the initial search, rather than using data that has already been pulled by some prior search, then this search will return only records on the index called "foo" which have both your search terms...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo  "user:info" "ifconfig"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For an initial search, that is the most efficient way.  &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;On the other hand, if you are trying to reduce a prior selection to only records which have both those fields, you could use either of these...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search  "user:info" AND "ifconfig"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| regex field=_raw "^.*?user:info.*?ifconfig.*$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;This regex will match events that have the two terms in that order...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^.*?user:info.*?ifconfig.*$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are additional things you could do to make the regex marginally more efficient when it FAILS to match the event, but that's all you really need.&lt;/P&gt;

&lt;P&gt;Note:  in some contexts the &lt;CODE&gt;:&lt;/CODE&gt; may need to be escaped, so the regex would look like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^.*?user\:info.*?ifconfig.*$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 13:49:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292137#M88252</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-03-23T13:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292138#M88253</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?ms)(?:user:info.*ifconfig)|(?:ifconfig.*user:info)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292138#M88253</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-23T14:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with regex in transforms.conf to find two words in an event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292139#M88254</link>
      <description>&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 06:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-regex-in-transforms-conf-to-find-two-words-in-an/m-p/292139#M88254</guid>
      <dc:creator>gerdhuber</dc:creator>
      <dc:date>2017-03-24T06:33:06Z</dc:date>
    </item>
  </channel>
</rss>

