<?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: Microsoft DNS debug logs.  Massaging log format. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44243#M10446</link>
    <description>&lt;P&gt;I have not done this but looking around I found this article talking about doing exacly what you are trying to do. It is for an older version of Splunk (4.1.3) but it is usefull:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/4546/field-extraction-regex-fu-help"&gt;http://splunk-base.splunk.com/answers/4546/field-extraction-regex-fu-help&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also check on this link for the updated information on SEDCMD, REGEX and SED: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.5/Data/Anonymizedatausingconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.5/Data/Anonymizedatausingconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically this is used to anonymize confidential data from the logs and can be used to replace values with different ones like what you are trying to do.&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2012 15:13:43 GMT</pubDate>
    <dc:creator>Mannyi31</dc:creator>
    <dc:date>2012-01-05T15:13:43Z</dc:date>
    <item>
      <title>Microsoft DNS debug logs.  Massaging log format.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44242#M10445</link>
      <description>&lt;P&gt;I have sending DNS debug log from forwarder on Windows 2003 to Splunk indexer:&lt;/P&gt;

&lt;P&gt;The DNS names in the log appear like this:&lt;/P&gt;

&lt;P&gt;(3)dns(8)msftncsi(3)com(0)&lt;BR /&gt;
 (3)www(16)google-analytics(3)com(0)&lt;/P&gt;

&lt;P&gt;I would like they to appear as: &lt;BR /&gt;
dns.msftncsi.com &lt;BR /&gt;
&lt;A href="http://www.google-analytics.com" target="_blank"&gt;www.google-analytics.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I want prepending (\d+) to be replaced with nothing and the other ones to be replaced with dots except the trailing one.&lt;/P&gt;

&lt;P&gt;I've figured out how to extract DNS names from the logs:&lt;/P&gt;

&lt;P&gt;(?i)] \w+\s+(?P&lt;DNS_NAME&gt;(.+))&lt;/DNS_NAME&gt;&lt;/P&gt;

&lt;P&gt;I found a way to rid of (\d+) stuff with the following statements in search: sourcetype="DNSDebugLog" | eval dns_name=replace(dns_name,"(\d+)",".") | eval dns_name=replace(dns_name,"^.","") | table dns_name&lt;/P&gt;

&lt;P&gt;but I do not want those to appear in the log at all. I want to replace those on the forwarder before the logs are sent to the indexer&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:16:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44242#M10445</guid>
      <dc:creator>ageld</dc:creator>
      <dc:date>2020-09-28T10:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft DNS debug logs.  Massaging log format.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44243#M10446</link>
      <description>&lt;P&gt;I have not done this but looking around I found this article talking about doing exacly what you are trying to do. It is for an older version of Splunk (4.1.3) but it is usefull:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://splunk-base.splunk.com/answers/4546/field-extraction-regex-fu-help"&gt;http://splunk-base.splunk.com/answers/4546/field-extraction-regex-fu-help&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also check on this link for the updated information on SEDCMD, REGEX and SED: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.5/Data/Anonymizedatausingconfigurationfiles"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.5/Data/Anonymizedatausingconfigurationfiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Basically this is used to anonymize confidential data from the logs and can be used to replace values with different ones like what you are trying to do.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2012 15:13:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44243#M10446</guid>
      <dc:creator>Mannyi31</dc:creator>
      <dc:date>2012-01-05T15:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Microsoft DNS debug logs.  Massaging log format.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44244#M10447</link>
      <description>&lt;P&gt;Recently read an article covering that very topic.  The following answers were found about 1/3 of the way down the following webpage: &lt;A href="http://stratumsecurity.com/2012/07/03/splunk-security/"&gt;http://stratumsecurity.com/2012/07/03/splunk-security/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The following rex was suggested to clean up the domain name:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="win_dns" imap | rex mode=sed "s/\(\d+\)/./g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Domain name field extraction was suggested with this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i) .*? \.(?P[-a-zA-Z0-9@:%_\+.~#?&amp;amp;amp;//=]{2,256}\.[a-z]{2,4})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Apr 2014 16:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Microsoft-DNS-debug-logs-Massaging-log-format/m-p/44244#M10447</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2014-04-21T16:29:00Z</dc:date>
    </item>
  </channel>
</rss>

