<?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: Escape a period in transforms regex to drop log? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492451#M137370</link>
    <description>&lt;P&gt;Your syntax for both &lt;CODE&gt;REGEX&lt;/CODE&gt; attributes is valid, but not necessarily "correct".&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sub,domain.com&lt;/CODE&gt; will match "sub" followed by any character followed by "domain" followed by any character followed by "com".  If you want to match dots, you need to escape them as in &lt;CODE&gt;sub\.domain\.com&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sub(6)domain(3)com&lt;/CODE&gt; will match "sub", "6", "domain", "3", and "com" in that order and will create capture groups for '6' and '3'.  To match parentheses you must escape the left paren as in &lt;CODE&gt;sub\(6)domain\(3)com&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 19:41:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-11-21T19:41:28Z</dc:date>
    <item>
      <title>Escape a period in transforms regex to drop log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492450#M137369</link>
      <description>&lt;P&gt;I'm collecting DNS logs and I'm trying to drop all logs with sub.domain.com as the query.  In my transforms.conf I have the following:&lt;/P&gt;

&lt;P&gt;[dropdomain]&lt;BR /&gt;
REGEX = sub.domain.com&lt;BR /&gt;
DEST_KEY=queue&lt;BR /&gt;
FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;But those domains still show up in my index.  I have this on both the HF and the Indexer for that sourcetype.&lt;/P&gt;

&lt;P&gt;I also am collecting logs from windows DNS debug log.  As you know those come across in (#)string(#)string(#)string(#) format.  So when the above comes through one of those logs, I have (3)sub(6)domain(3)com(0) in my log.  I'm trying to drop those also and here is my transforms.conf for that log:&lt;/P&gt;

&lt;P&gt;[dropdomain]&lt;BR /&gt;
REGEX = sub(6)domain(3)com&lt;BR /&gt;
DEST_KEY=queue&lt;BR /&gt;
FORMAT=nullQueue&lt;/P&gt;

&lt;P&gt;But that isn't working either.  Is my syntax correct?  Do I need to escape the period or not? Do I escape the parenthesis or not?  &lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;(I'm sure this question has been asked before, but I have not found the right google-fu to get the answer)&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 19:03:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492450#M137369</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2019-11-21T19:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Escape a period in transforms regex to drop log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492451#M137370</link>
      <description>&lt;P&gt;Your syntax for both &lt;CODE&gt;REGEX&lt;/CODE&gt; attributes is valid, but not necessarily "correct".&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sub,domain.com&lt;/CODE&gt; will match "sub" followed by any character followed by "domain" followed by any character followed by "com".  If you want to match dots, you need to escape them as in &lt;CODE&gt;sub\.domain\.com&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sub(6)domain(3)com&lt;/CODE&gt; will match "sub", "6", "domain", "3", and "com" in that order and will create capture groups for '6' and '3'.  To match parentheses you must escape the left paren as in &lt;CODE&gt;sub\(6)domain\(3)com&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 19:41:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492451#M137370</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-11-21T19:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Escape a period in transforms regex to drop log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492452#M137371</link>
      <description>&lt;P&gt;First, thank you for the tips.&lt;/P&gt;

&lt;P&gt;And this is where I should have reviewed my post. I actually had&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sub\.domain\.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sub\(6\)domain\(3\)com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but missed the reformatting changes after post.  &lt;/P&gt;

&lt;P&gt;Your answer helps.  I will try both of those things.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 19:46:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492452#M137371</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2019-11-21T19:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Escape a period in transforms regex to drop log?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492453#M137372</link>
      <description>&lt;P&gt;OK, this is how I got things to work.  I used:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = \[.+?\]\s+\w+\s+.+?sub.+?domain.+?com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think I got that syntax from somewhere, but I can't find the reference....&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 19:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Escape-a-period-in-transforms-regex-to-drop-log/m-p/492453#M137372</guid>
      <dc:creator>reswob4</dc:creator>
      <dc:date>2019-11-22T19:41:04Z</dc:date>
    </item>
  </channel>
</rss>

