Dashboards & Visualizations

xml like log

cboillot
Contributor

I have a log that I am trying to parse and I am unable to figure this out. It looks like a type of XML file. Here is an example:

<ErrorMessage Id='20200130111127151' Date='1/30/2020' Time='11:11 AM' >
  <RequestInformation
     Hostname='1.2.3.4' 
     HostAddress='5.6.7.8'
     HostBrowser='Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000)'
     ReferringPage=''
     RequestType='POST'
     ContentLength='505'
     RawUrl='/dir/subdir/filename.asmx'>
    <Browser Type='IE6' Browser='IE' Version='6.0' Platform='Unknown' SupportsFrames='True' SupportsJavascript='True' SupportsTables='True'SupportsCookies='True'/>
    <Cookies>
    </Cookies>
    <Form>
    </Form>
  </RequestInformation>
  <Exception Message='ORA-01017: invalid username/password; logon denied'>
    <StackTrace>
      <![CDATA[
   at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction)
   at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction m_oracleLogicalTransaction)
   at Oracle.DataAccess.Client.OracleConnection.Open()
   at dhss.webservice.login_ws.MExecuteComponent.AuthenticateToAPP(String UserID, String Password, String DBInstance, String ServerIP, String ServerPort)
]]>
    </StackTrace>
  </Exception>
</ErrorMessage>

I have the Add-on for Oracle database installed, but it don't seem to work with this one.

Tags (2)
0 Karma
1 Solution

dindu
Contributor

Hi,

You could try something like below during the search time by using the spath command
Please rename the fields and use table command to display the fields better,

     |makeresults
     |eval _raw="<ErrorMessage Id='20200130111127151' Date='1/30/2020' Time='11:11 AM' >
        <RequestInformation
           Hostname='1.2.3.4' 
           HostAddress='5.6.7.8'
           HostBrowser='Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000)'
           ReferringPage=''
           RequestType='POST'
           ContentLength='505'
           RawUrl='/dir/subdir/filename.asmx'>
          <Browser Type='IE6' Browser='IE' Version='6.0' Platform='Unknown' SupportsFrames='True' SupportsJavascript='True' SupportsTables='True'SupportsCookies='True'/>
          <Cookies>
          </Cookies>
          <Form>
          </Form>
        </RequestInformation>
        <Exception Message='ORA-01017: invalid username/password; logon denied'>
          <StackTrace>
            <![CDATA[
         at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction)
         at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction m_oracleLogicalTransaction)
         at Oracle.DataAccess.Client.OracleConnection.Open()
         at dhss.webservice.login_ws.MExecuteComponent.AuthenticateToAPP(String UserID, String Password, String DBInstance, String ServerIP, String ServerPort)
      ]]>
          </StackTrace>
        </Exception>
      </ErrorMessage>"
      |spath input=_raw

You could also add KV_MODE = xml in the props.conf and breaking the lines appropriately

      KV_MODE = xml

View solution in original post

0 Karma

dindu
Contributor

Hi,

You could try something like below during the search time by using the spath command
Please rename the fields and use table command to display the fields better,

     |makeresults
     |eval _raw="<ErrorMessage Id='20200130111127151' Date='1/30/2020' Time='11:11 AM' >
        <RequestInformation
           Hostname='1.2.3.4' 
           HostAddress='5.6.7.8'
           HostBrowser='Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000)'
           ReferringPage=''
           RequestType='POST'
           ContentLength='505'
           RawUrl='/dir/subdir/filename.asmx'>
          <Browser Type='IE6' Browser='IE' Version='6.0' Platform='Unknown' SupportsFrames='True' SupportsJavascript='True' SupportsTables='True'SupportsCookies='True'/>
          <Cookies>
          </Cookies>
          <Form>
          </Form>
        </RequestInformation>
        <Exception Message='ORA-01017: invalid username/password; logon denied'>
          <StackTrace>
            <![CDATA[
         at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction)
         at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src, OracleLogicalTransaction m_oracleLogicalTransaction)
         at Oracle.DataAccess.Client.OracleConnection.Open()
         at dhss.webservice.login_ws.MExecuteComponent.AuthenticateToAPP(String UserID, String Password, String DBInstance, String ServerIP, String ServerPort)
      ]]>
          </StackTrace>
        </Exception>
      </ErrorMessage>"
      |spath input=_raw

You could also add KV_MODE = xml in the props.conf and breaking the lines appropriately

      KV_MODE = xml
0 Karma

cboillot
Contributor

I have tried the KV_MODE = xml and it didn't seem to do anything.

0 Karma

dindu
Contributor

Set the linebreaker in props.conf as

     LINE_BREAKER = </ErrorMessage>
0 Karma

cboillot
Contributor

Now I am seeing results with tick marks, like this

'ASP.NET_SessionId'
0 Karma

cboillot
Contributor

looks like this might have been what was needed. thanks.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...