<?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 Parsing XML - ignore new line in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-ignore-new-line/m-p/528945#M89139</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to parse a complex xml and asking about the regex for&amp;nbsp;SEDCMD-abremoveheader which refers to line 3 of the xml or further below.&amp;nbsp; (*s) works in regex101.com but not in Splunk SEDCMD-abremoveheader.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below solution is NOT SUFFICIENT because it refers to the first 2 lines only.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;SEDCMD-abremoveheader&amp;nbsp; to start from the desired location.&amp;nbsp;&lt;BR /&gt;I works when it is about the first two lines.&amp;nbsp;&lt;BR /&gt;It does not work when it is the 3rd or any other line further below.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is an example xml:&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;BR /&gt;&amp;lt;config version="8.1.0" daaa="dummy"&amp;gt;&lt;BR /&gt;&amp;lt;something&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following works fine in Splunk xml parsing:&lt;/P&gt;&lt;P&gt;SEDCMD-abremoveheader = s/\&amp;lt;\?xml.*\s*\&amp;lt;config.*\&amp;gt;\s*//g&lt;/P&gt;&lt;P&gt;The following does not work in splunk xml parsing and also not in regex101.com&lt;/P&gt;&lt;P&gt;SEDCMD-abremoveheader = s/\&amp;lt;\?xml.*\s*\&amp;lt;somthing.*\&amp;gt;\s*//g&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The following ***works in regx101.com*** but not in Splunk xml parsing:&lt;/P&gt;&lt;P&gt;(?s)\&amp;lt;\?xml.*\s*\&amp;lt;something.*\&amp;gt;\s*&lt;/P&gt;&lt;P&gt;The (?s) says to ignore any char including new lines.&amp;nbsp;&lt;BR /&gt;Also tried (?m) - does not work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2020 13:23:03 GMT</pubDate>
    <dc:creator>sbaror11</dc:creator>
    <dc:date>2020-11-11T13:23:03Z</dc:date>
    <item>
      <title>Parsing XML - ignore new line</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-ignore-new-line/m-p/528945#M89139</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/15147"&gt;@somesoni2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to parse a complex xml and asking about the regex for&amp;nbsp;SEDCMD-abremoveheader which refers to line 3 of the xml or further below.&amp;nbsp; (*s) works in regex101.com but not in Splunk SEDCMD-abremoveheader.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below solution is NOT SUFFICIENT because it refers to the first 2 lines only.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-and-props-conf-help/m-p/158263&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;SEDCMD-abremoveheader&amp;nbsp; to start from the desired location.&amp;nbsp;&lt;BR /&gt;I works when it is about the first two lines.&amp;nbsp;&lt;BR /&gt;It does not work when it is the 3rd or any other line further below.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is an example xml:&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;BR /&gt;&amp;lt;config version="8.1.0" daaa="dummy"&amp;gt;&lt;BR /&gt;&amp;lt;something&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following works fine in Splunk xml parsing:&lt;/P&gt;&lt;P&gt;SEDCMD-abremoveheader = s/\&amp;lt;\?xml.*\s*\&amp;lt;config.*\&amp;gt;\s*//g&lt;/P&gt;&lt;P&gt;The following does not work in splunk xml parsing and also not in regex101.com&lt;/P&gt;&lt;P&gt;SEDCMD-abremoveheader = s/\&amp;lt;\?xml.*\s*\&amp;lt;somthing.*\&amp;gt;\s*//g&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The following ***works in regx101.com*** but not in Splunk xml parsing:&lt;/P&gt;&lt;P&gt;(?s)\&amp;lt;\?xml.*\s*\&amp;lt;something.*\&amp;gt;\s*&lt;/P&gt;&lt;P&gt;The (?s) says to ignore any char including new lines.&amp;nbsp;&lt;BR /&gt;Also tried (?m) - does not work either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 13:23:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Parsing-XML-ignore-new-line/m-p/528945#M89139</guid>
      <dc:creator>sbaror11</dc:creator>
      <dc:date>2020-11-11T13:23:03Z</dc:date>
    </item>
  </channel>
</rss>

