<?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: Why is my WS_FTP XML Log not parsing correctly? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299075#M56567</link>
    <description>&lt;P&gt;If you want to get rid of all of the &lt;CODE&gt;entry&lt;/CODE&gt; prefixes in the field names, you can always do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename entry.* AS *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should strip off the prefix.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Feb 2017 03:39:54 GMT</pubDate>
    <dc:creator>gvmorley</dc:creator>
    <dc:date>2017-02-15T03:39:54Z</dc:date>
    <item>
      <title>Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299073#M56565</link>
      <description>&lt;P&gt;I am attempting to import a ws_ftp log, but I am having issues parsing the log data.  I can either get it to have no fields extracted or I end up with hundreds of entries for each event as it does not appear to break properly.&lt;/P&gt;

&lt;P&gt;Sample log data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
    &amp;lt;log&amp;gt;
      &amp;lt;entry&amp;gt;
        &amp;lt;log_time&amp;gt;20170214-10:59:58&amp;lt;/log_time&amp;gt;
        &amp;lt;description&amp;gt;&amp;lt;![CDATA[Authentication succeed]]&amp;gt;&amp;lt;/description&amp;gt;
        &amp;lt;service&amp;gt;COM_API&amp;lt;/service&amp;gt;
        &amp;lt;sessionid&amp;gt;00000001&amp;lt;/sessionid&amp;gt;
        &amp;lt;type&amp;gt;0&amp;lt;/type&amp;gt;    &amp;lt;severity&amp;gt;1&amp;lt;/severity&amp;gt;
        &amp;lt;user&amp;gt;test&amp;lt;/user&amp;gt;
        &amp;lt;host&amp;gt;ftp&amp;lt;/host&amp;gt;
        &amp;lt;cmd&amp;gt;Login&amp;lt;/cmd&amp;gt;
        &amp;lt;sguid&amp;gt;278AA2E9-04A9-4484-9EAC-DF1EACBDF372&amp;lt;/sguid&amp;gt;
      &amp;lt;/entry&amp;gt;
      &amp;lt;entry&amp;gt;
        &amp;lt;log_time&amp;gt;20170214-11:01:39&amp;lt;/log_time&amp;gt;
        &amp;lt;description&amp;gt;&amp;lt;![CDATA[Created user test on host ftp]]&amp;gt;&amp;lt;/description&amp;gt;
        &amp;lt;service&amp;gt;COM_API&amp;lt;/service&amp;gt;
        &amp;lt;sessionid&amp;gt;00000001&amp;lt;/sessionid&amp;gt;
        &amp;lt;type&amp;gt;0&amp;lt;/type&amp;gt;    &amp;lt;severity&amp;gt;1&amp;lt;/severity&amp;gt;
        &amp;lt;user&amp;gt;test&amp;lt;/user&amp;gt;
        &amp;lt;host&amp;gt;ftp&amp;lt;/host&amp;gt;
        &amp;lt;cmd&amp;gt;CreateUser&amp;lt;/cmd&amp;gt;
        &amp;lt;sguid&amp;gt;278AA2E9-04A9-4484-9EAC-DF1EACBDF372&amp;lt;/sguid&amp;gt;
      &amp;lt;/entry&amp;gt;
      &amp;lt;entry&amp;gt;
        &amp;lt;log_time&amp;gt;20170214-11:01:39&amp;lt;/log_time&amp;gt;
        &amp;lt;description&amp;gt;&amp;lt;![CDATA[User test sysadmin set to TRUE on host ftp]]&amp;gt;&amp;lt;/description&amp;gt;
        &amp;lt;service&amp;gt;COM_API&amp;lt;/service&amp;gt;
        &amp;lt;sessionid&amp;gt;00000001&amp;lt;/sessionid&amp;gt;
        &amp;lt;type&amp;gt;0&amp;lt;/type&amp;gt;    &amp;lt;severity&amp;gt;1&amp;lt;/severity&amp;gt;
        &amp;lt;user&amp;gt;test&amp;lt;/user&amp;gt;
        &amp;lt;host&amp;gt;ftp&amp;lt;/host&amp;gt;
        &amp;lt;cmd&amp;gt;SetSysAdmin&amp;lt;/cmd&amp;gt;
        &amp;lt;sguid&amp;gt;278AA2E9-04A9-4484-9EAC-DF1EACBDF372&amp;lt;/sguid&amp;gt;
      &amp;lt;/entry&amp;gt;
    &amp;lt;/log&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From some post I have created a props.conf file of:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [WS_FTP]
    TIME_PREFIX = \&amp;lt;log_time\&amp;gt;
    TIME_FORMAT = %Y\%m\%d-%H:%M:%S
    SHOULD_LINEMERGE = false
    LINE_BREAKER = \&amp;gt;\s*(?=\&amp;lt;entry\&amp;gt;)
    REPORT-xmlext = xml-extr
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and a transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xml-extr]
REGEX = &amp;lt;([^&amp;gt;]+)&amp;gt;([^&amp;lt;]*)&amp;lt;\/\1&amp;gt;
FORMAT = $1::$2
MV_ADD = true
REPEAT_MATCH = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to have each entry listed with the associated data as opposed to what i am getting now where there is an event for: ,  278AA2E9-04A9-4484-9EAC-DF1EACBDF372, etc.&lt;/P&gt;

&lt;P&gt;It seems to be right there, but still something is not working.  I have tried without the transforms and only that props.conf, but that too yields similar results, so any help in getting each "entry" properly extracted would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2017 21:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299073#M56565</guid>
      <dc:creator>smakovits</dc:creator>
      <dc:date>2017-02-14T21:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299074#M56566</link>
      <description>&lt;P&gt;Try using KV_MODE=xml in props.conf and remove your transforms.conf. This appears to be working fine for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[WS_FTP]
BREAK_ONLY_BEFORE = &amp;lt;entry&amp;gt;
DATETIME_CONFIG = 
NO_BINARY_CHECK = true
TIME_FORMAT = %Y%m%d-%H:%M:%S
TIME_PREFIX = \&amp;lt;log_time\&amp;gt;
KV_MODE = xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll end up with fields prefaced with the "entry" label, like "entry.description", "entry.sguid", etc. You'll want to play with the line breaking if you want to get rid of the preface of "entry.*".&lt;/P&gt;

&lt;P&gt;Edit: Using your LINE_BREAKER, kind of like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    [WS_FTP]
    DATETIME_CONFIG = 
    KV_MODE = xml
    LINE_BREAKER = \&amp;gt;\s*(?=\&amp;lt;entry\&amp;gt;)
    NO_BINARY_CHECK = true
    TIME_FORMAT = %Y%m%d-%H:%M:%S
    TIME_PREFIX = \&amp;lt;log_time\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 00:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299074#M56566</guid>
      <dc:creator>coltwanger</dc:creator>
      <dc:date>2017-02-15T00:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299075#M56567</link>
      <description>&lt;P&gt;If you want to get rid of all of the &lt;CODE&gt;entry&lt;/CODE&gt; prefixes in the field names, you can always do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename entry.* AS *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Should strip off the prefix.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 03:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299075#M56567</guid>
      <dc:creator>gvmorley</dc:creator>
      <dc:date>2017-02-15T03:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299076#M56568</link>
      <description>&lt;P&gt;super awesome, this worked.  Fields extracted as you noted.&lt;/P&gt;

&lt;P&gt;I added the below field alias, but then I ended up with both the formatted and unformatted fields.  Not sure if I will keep it or just add the search time rename as noted below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;FIELDALIAS-rootfields = entry.log_time as Time entry.description as Description entry.user as User entry.cmd as Command entry.service as Service entry.severity as Severity entry.sguid as SGUID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For the record, I want to make sure I put this into the correct props.conf file.  I added it under system as there is no app for ws_ftp to add it to.  Or should it go under the search app?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:36:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299076#M56568</guid>
      <dc:creator>smakovits</dc:creator>
      <dc:date>2017-02-15T15:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299077#M56569</link>
      <description>&lt;P&gt;I was curious, is there any way to make the search time rename a permanent thing?  I did the field alias, but I end up with the entry.description and Description then.&lt;/P&gt;

&lt;P&gt;I was looking at the docs, but nothing was super obvious.  Hoping this too is something simple.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 15:37:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299077#M56569</guid>
      <dc:creator>smakovits</dc:creator>
      <dc:date>2017-02-15T15:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299078#M56570</link>
      <description>&lt;P&gt;If you use the LINE_BREAKER in my edit, it will automatically remove the line you are breaking the events on, which in turn removes the tree'd out format of "entry.$field$" (because it no longer exists in the log). &lt;/P&gt;

&lt;P&gt;System should be fine. I personally create a new app on a per-system basis for organizational purposes, but in search or system should be fine. If you place it in search, it's possible you won't be able to use the extractions within other apps -- in that case you'll need to share the objects in the search app globally.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 17:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299078#M56570</guid>
      <dc:creator>coltwanger</dc:creator>
      <dc:date>2017-02-15T17:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299079#M56571</link>
      <description>&lt;P&gt;Awesome work, the LINE_BREAKER works.  Before you posted that, I also figured out how to do it with the FIELDALIAS and then EVAL null the original values, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#[WS_FTP]
#BREAK_ONLY_BEFORE = &amp;lt;entry&amp;gt;
#DATETIME_CONFIG = 
#NO_BINARY_CHECK = true
#TIME_FORMAT = %Y%m%d-%H:%M:%S
#TIME_PREFIX = \&amp;lt;log_time\&amp;gt;
#FIELDALIAS-rootfields = entry.log_time as Time entry.description as Description entry.user as User entry.cmd as Command entry.service as Service entry.severity as Severity entry.sguid as SGUID entry.host as Host entry.sessionid as Session_ID entry.type as Type
#EVAL-entry.log_time = null
#EVAL-entry.description = null
#EVAL-entry.user = null
#EVAL-entry.cmd = null
#EVAL-entry.service = null
#EVAL-entry.severity = null
#EVAL-entry.sguid = null
#EVAL-entry.host = null
#EVAL-entry.sessionid = null
#EVAL-entry.type = null
#KV_MODE = xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the end, both seem to work, but the key was the main extract so thanks a million&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 18:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299079#M56571</guid>
      <dc:creator>smakovits</dc:creator>
      <dc:date>2017-02-15T18:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my WS_FTP XML Log not parsing correctly?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299080#M56572</link>
      <description>&lt;P&gt;Very cool! I've run into this with a few logs and this might help me clean them up a bit.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 18:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-my-WS-FTP-XML-Log-not-parsing-correctly/m-p/299080#M56572</guid>
      <dc:creator>coltwanger</dc:creator>
      <dc:date>2017-02-15T18:20:18Z</dc:date>
    </item>
  </channel>
</rss>

