<?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: XML log source type in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12856#M1055</link>
    <description>&lt;P&gt;Lowell's answer here looks pretty sane.  Remember that once the breaking is done, you can pipe results to xmlkv for some pretty nifty automatic field extraction.&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2010 18:37:02 GMT</pubDate>
    <dc:creator>bfaber</dc:creator>
    <dc:date>2010-05-06T18:37:02Z</dc:date>
    <item>
      <title>XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12853#M1052</link>
      <description>&lt;P&gt;I cannot find much helpful documentation on handling XML log files. This link seems to be on the right track but what happens if I have multiple log file formats with different element names:
&lt;A href="http://www.splunk.com/wiki/Deploy:HowToWorkWithXMLLogFiles" rel="nofollow"&gt;http://www.splunk.com/wiki/Deploy:HowToWorkWithXMLLogFiles&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Am I supposed to see xml_file as a source file type? I don't see it in the list of source types.&lt;/P&gt;

&lt;P&gt;Here's what I'm wanting to parse. Its an Oracle database xml audit log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;Audit xmlns="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-10_2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/oracleas/schema/dbserver_audittrail-10_2.xsd"&amp;gt;
&amp;lt;Version&amp;gt;10.2&amp;lt;/Version&amp;gt;
&amp;lt;AuditRecord&amp;gt;
    &amp;lt;Audit_Type&amp;gt;1&amp;lt;/Audit_Type&amp;gt;
    &amp;lt;Session_Id&amp;gt;735807&amp;lt;/Session_Id&amp;gt;
    &amp;lt;StatementId&amp;gt;9&amp;lt;/StatementId&amp;gt;
    &amp;lt;EntryId&amp;gt;1&amp;lt;/EntryId&amp;gt;
    &amp;lt;Extended_Timestamp&amp;gt;2010-05-02T23:14:49.399000&amp;lt;/Extended_Timestamp&amp;gt;
    &amp;lt;DB_User&amp;gt;FRAMEWK&amp;lt;/DB_User&amp;gt;
    &amp;lt;Client_Id&amp;gt;framewk&amp;lt;/Client_Id&amp;gt;
    &amp;lt;OS_User&amp;gt;jsoap&amp;lt;/OS_User&amp;gt;
    &amp;lt;Userhost&amp;gt;BIOA171&amp;lt;/Userhost&amp;gt;
    &amp;lt;OS_Process&amp;gt;1680:6008&amp;lt;/OS_Process&amp;gt;
    &amp;lt;Terminal&amp;gt;unknown&amp;lt;/Terminal&amp;gt;
    &amp;lt;Instance_Number&amp;gt;0&amp;lt;/Instance_Number&amp;gt;
    &amp;lt;Object_Schema&amp;gt;FRAMEWK&amp;lt;/Object_Schema&amp;gt;
    &amp;lt;Object_Name&amp;gt;APP_USER&amp;lt;/Object_Name&amp;gt;
    &amp;lt;Action&amp;gt;3&amp;lt;/Action&amp;gt;
    &amp;lt;Returncode&amp;gt;0&amp;lt;/Returncode&amp;gt;
    &amp;lt;Scn&amp;gt;1098595781&amp;lt;/Scn&amp;gt;
    &amp;lt;Sql_Text&amp;gt;SELECT ... FROM ...&amp;lt;/Sql_Text&amp;gt;
&amp;lt;/AuditRecord&amp;gt;
&amp;lt;/Audit&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 May 2010 01:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12853#M1052</guid>
      <dc:creator>cparham</dc:creator>
      <dc:date>2010-05-05T01:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12854#M1053</link>
      <description>&lt;P&gt;I think you have to define it as a source type - and use the example above as a guide.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 01:53:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12854#M1053</guid>
      <dc:creator>John_Mark</dc:creator>
      <dc:date>2010-05-05T01:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12855#M1054</link>
      <description>&lt;P&gt;I have a number of oracle related sourcetypes defined in a custom app, but I haven't come across this one before.  Here is an XML config that I've modified to match your given log file sample.&lt;/P&gt;

&lt;P&gt;Entries for &lt;CODE&gt;props.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::...[/\\][Oo]racle...[/\\]logs?...[/\\]audit.xml]
sourcetype = oracle_audit_xml

[oracle_audit_xml]
TIME_PREFIX = &amp;lt;Extended_Timestamp&amp;gt;
MAX_TIMESTAMP_LOOKAHEAD = 200
BREAK_ONLY_BEFORE = ^&amp;lt;AuditRecord&amp;gt;
BREAK_ONLY_BEFORE_DATE = False
SHOULD_LINEMERGE = True
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notes:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;You will need to update the &lt;CODE&gt;[source::]&lt;/CODE&gt; pattern based on the file names of these log files.&lt;/LI&gt;
&lt;LI&gt;I'm assuming that if you have multiple log entries in a single file, then it's the &lt;CODE&gt;&amp;lt;AuditRecord&amp;gt;&lt;/CODE&gt; will occur multiple times.  Event breaking with XML is klugy, since XML was never meant for logs (IMHO), and it can't properly exist in fragments, so you'll probably end up with some extra junk before/after some of the very first or very last log entries.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;If you provide a multiple-event example, someone could probably give you a better starting point.&lt;/P&gt;</description>
      <pubDate>Wed, 05 May 2010 21:59:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12855#M1054</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-05-05T21:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12856#M1055</link>
      <description>&lt;P&gt;Lowell's answer here looks pretty sane.  Remember that once the breaking is done, you can pipe results to xmlkv for some pretty nifty automatic field extraction.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2010 18:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12856#M1055</guid>
      <dc:creator>bfaber</dc:creator>
      <dc:date>2010-05-06T18:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12857#M1056</link>
      <description>&lt;P&gt;Any suggestions on how to remove line breaks found inside elements &lt;SQL_TEXT&gt;...&lt;/SQL_TEXT&gt;. Many of the SQL statements inside &lt;SQL_TEXT&gt; tags have hard line breaks often at very undesirable places.&lt;/SQL_TEXT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2010 03:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12857#M1056</guid>
      <dc:creator>cparham</dc:creator>
      <dc:date>2010-08-05T03:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12858#M1057</link>
      <description>&lt;P&gt;You can do this at search time by doing something like this:   &lt;CODE&gt;sourcetype=oracle_audit_xml | xmlkv | regex field=Sql_Text mode=sed "s/[\r\n]+/ /g"&lt;/CODE&gt;  Basically we are just replacing any end-of-line characters with a single space.  Another approach would be to modify the raw event at index time, but that would be more difficult and I wouldn't recommend it unless you have some really good reasons.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2010 20:29:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12858#M1057</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-05T20:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: XML log source type</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12859#M1058</link>
      <description>&lt;P&gt;Whoops, that should be "rex" not "regex" in the example command above.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2010 21:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/XML-log-source-type/m-p/12859#M1058</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-05T21:09:07Z</dc:date>
    </item>
  </channel>
</rss>

