<?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 can I extract a domain name from a Windows 2008 DNS Debug Log in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101656#M21313</link>
    <description>&lt;P&gt;@BP9906, simply modify the regex statment to meet your needs.  My regexes are only written to meet  the samples provided.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Feb 2013 17:27:26 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2013-02-13T17:27:26Z</dc:date>
    <item>
      <title>How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101648#M21305</link>
      <description>&lt;P&gt;New to SPLUNK but so far its great!  &lt;/P&gt;

&lt;P&gt;I have a Windows 2008 DNS debug log that contains domain names. I need to define a field DOMAIN so I can extract these domain names and compare them to a watchlist of known botnet domains.  Nothing new i dont think. My records look like below.&lt;/P&gt;

&lt;P&gt;My10/24/2012 1:46:58 PM 077C PACKET  0000000003AF6580 UDP Rcv 10.41.72.18     31a0   Q [0001   D   NOERROR] A      .ixa-mar11.global.amec.com. &lt;/P&gt;

&lt;P&gt;10/24/2012 1:44:00 PM 077C PACKET  0000000003A0DB50 UDP Snd 195.59.44.133   1275   Q [1000       NOERROR] A      .fpdownload.macromedia.com.edgekey.net.&lt;/P&gt;

&lt;P&gt;I am trying to use the built in  SPLUNK &amp;gt; Extract Fields  but it has a problem with the variable length domain names.  I cannot generate a REGEX command to do this for me to save me.  Since the domain names can be variable in lenght i just cant get it.&lt;/P&gt;

&lt;P&gt;Any help would be tremedously appreciated. &lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101648#M21305</guid>
      <dc:creator>bill_dishman</dc:creator>
      <dc:date>2012-10-24T18:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101649#M21306</link>
      <description>&lt;P&gt;I would match from the right.  I've tested this with Regex Buddy with sample set you provided.&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
.(?P&amp;lt;dc_name&amp;gt;[^\s]+)$&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
                                                                  start    Length&lt;BR /&gt;
Match 1:     .ixa-mar11.global.amec.com.                       114      28&lt;BR /&gt;
Match 2:     .fpdownload.macromedia.com.edgekey.net.       256      40&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps or gets you started.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:13:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101649#M21306</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-10-24T18:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101650#M21307</link>
      <description>&lt;P&gt;Thanks for the help. I am really new to this. So i went back to SPLUNK&amp;gt;Extract and put what you have given me into the "Generated pattern (regex)" where i can EDIT it .. and I now have this: &lt;BR /&gt;
 (?i) A .(?P&lt;FIELDNAME&gt;[^s]+)$ &lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;fieldname = your dc_name   &lt;/P&gt;

&lt;P&gt;When i APPLY this,  or TEST it, it shows me my data, and hightlights the matches , but only shows me highlighted domain names but not all of them in the data set. &lt;BR /&gt;
Sorry i dont know much about this. First time.  Do you think i am good???????  Looks good. &lt;/P&gt;

&lt;P&gt;And. Thank you very very much&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:37:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101650#M21307</guid>
      <dc:creator>bill_dishman</dc:creator>
      <dc:date>2012-10-24T18:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101651#M21308</link>
      <description>&lt;P&gt;Not sure if I understand what you mean by all of them in the dataset.  If the field extractor is not highlighting all domain names in your data set then the regex should be rewritten/modified for your needs.   Given your limited sample it dificult to build a regex for all possiblities.&lt;/P&gt;

&lt;P&gt;I would recommend purchasing a product like RegEx Buddy and visiting &lt;A href="http://www.regular-expressions.info"&gt;http://www.regular-expressions.info&lt;/A&gt; which has great info.  I still reference occationaly.&lt;/P&gt;

&lt;P&gt;Sorry if I couldn't be of more assitance to you.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101651#M21308</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-10-24T18:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101652#M21309</link>
      <description>&lt;P&gt;I just dont see my domain field in all records in a search.&lt;/P&gt;

&lt;P&gt;56 » 10/24/110/24/2012 2:10:51 PM 077C PACKET  0000000003592E80 UDP Rcv 10.41.72.18     df51   Q [0001   D   NOERROR] A      .avamericas2.global.amec.com.host=ATT1-DNS1   Options|  sourcetype=WINDNS   Options|  source=C:\dns.log   Options &lt;/P&gt;

&lt;P&gt;57 » 10/24/12&lt;BR /&gt;
2:01:58.000 PM  10/24/2012 2:01:58 PM 077C PACKET  UDP Snd 217.19.248.20   6688   Q [1000       NOERROR] A      .ixa-mar11.global.amec.com.host=ATT1-DNS1   Options|  sourcetype=WINDNS   Options|  source=C:\dns.log   Options|  domain=ixa-mar11.global.amec.com.   Options&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101652#M21309</guid>
      <dc:creator>bill_dishman</dc:creator>
      <dc:date>2012-10-24T19:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101653#M21310</link>
      <description>&lt;P&gt;You have been a great help.. much closer than i was and learing a few things!   take care&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2012 19:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101653#M21310</guid>
      <dc:creator>bill_dishman</dc:creator>
      <dc:date>2012-10-24T19:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101654#M21311</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/76687"&gt;@bill_dishman&lt;/a&gt;, Here are some variations of the regex statement. Thy all work with the samples your provided from you comment and your question. Its possible you have a char or whitespace that I am not accounting for Hope this helps.  &lt;/P&gt;

&lt;P&gt;Don't foget to thumbs up or accepts answer on the board.&lt;/P&gt;

&lt;P&gt;Cheers.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
(?ims).(?P&amp;lt;dc_name&amp;gt;[^\s]+)(?:(?:\s{0})|\s+)$&lt;BR /&gt;
(?ims)\s.{0,1}(?P&lt;DC_NAME&gt;[^\s]+)(?:(?:\s{0})|\s+)$&lt;BR /&gt;
(?ims).{0,1}(?P&lt;DC_NAME&gt;[^\s]+)(?:(?:\s{0})|\s+)$&lt;BR /&gt;
&lt;/DC_NAME&gt;&lt;/DC_NAME&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:41:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101654#M21311</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2020-09-28T12:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101655#M21312</link>
      <description>&lt;P&gt;The problem with the above answers is that 2008 R2+ servers log in a format like:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
2/12/2013 3:33:47 PM 17D4 PACKET  0000000004236180 UDP Rcv 10.1.1.1    4666   Q [0001   D   NOERROR] A      (4)host(9)subdomain(7)domain(3)com(0)&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
So you have to extract it and take into account the (#) that counts the characters provided. &lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2013 23:35:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101655#M21312</guid>
      <dc:creator>BP9906</dc:creator>
      <dc:date>2013-02-12T23:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract a domain name from a Windows 2008 DNS Debug Log</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101656#M21313</link>
      <description>&lt;P&gt;@BP9906, simply modify the regex statment to meet your needs.  My regexes are only written to meet  the samples provided.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2013 17:27:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-I-extract-a-domain-name-from-a-Windows-2008-DNS-Debug/m-p/101656#M21313</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2013-02-13T17:27:26Z</dc:date>
    </item>
  </channel>
</rss>

