<?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 Why is inline conversion of XML string using XMLKV not working? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225053#M44017</link>
    <description>&lt;P&gt;I have the following search which extracts the inner XML pieces.  I'm trying to re-parse the resulting strings into XML using &lt;CODE&gt;xmlkv&lt;/CODE&gt; for additional extraction and it is not working properly...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_suite_result_xml" | xpath outfield=testCase "//testSuite/testRunnerResults/testCase" | mvexpand testCase
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns a list of these:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;testCase&amp;gt; &amp;lt;startTime&amp;gt;15:45:45&amp;lt;/startTime&amp;gt; &amp;lt;status&amp;gt;FINISHED&amp;lt;/status&amp;gt; &amp;lt;testCaseId&amp;gt;027c9aec-3802-480c-8f5e-637ebcd192d9&amp;lt;/testCaseId&amp;gt; &amp;lt;testCaseName&amp;gt;UC-CR-0010&amp;lt;/testCaseName&amp;gt; &amp;lt;timeTaken&amp;gt;608&amp;lt;/timeTaken&amp;gt; &amp;lt;testStepResults&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 1 [MINT-BE-GetApplicationAndBaseUrl] OK: took 129 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-GetApplicationAndBaseUrl&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;2&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.256&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;129&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 2 [MINT-BE-StartSession] OK: took 237 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-StartSession&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;3&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.445&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;237&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 3 [Transfer_JSessionID] OK: took 4 ms -&amp;gt; Script-result: org.mozilla.javascript.Undefined@689cc181&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;Transfer_JSessionID&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;4&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.726&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;4&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 4 [MINT-BE-GetUser] OK: took 115 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-GetUser&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;5&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.751&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;115&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 5 [MINT-BE-EndSession] OK: took 123 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-EndSession&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;6&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.905&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;123&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;/testStepResults&amp;gt; &amp;lt;failedTestSteps/&amp;gt; &amp;lt;/testCase&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, adding &lt;CODE&gt;xmlkv&lt;/CODE&gt; after and trying to extract the &lt;STRONG&gt;testCaseNames&lt;/STRONG&gt; returns nothing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_suite_result_xml" | xpath outfield=testCase "//testSuite/testRunnerResults/testCase" | mvexpand testCase | eval _raw=testCase | xmlkv | table testCase.testCaseName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Nov 2015 20:33:04 GMT</pubDate>
    <dc:creator>dablackgoku1234</dc:creator>
    <dc:date>2015-11-11T20:33:04Z</dc:date>
    <item>
      <title>Why is inline conversion of XML string using XMLKV not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225053#M44017</link>
      <description>&lt;P&gt;I have the following search which extracts the inner XML pieces.  I'm trying to re-parse the resulting strings into XML using &lt;CODE&gt;xmlkv&lt;/CODE&gt; for additional extraction and it is not working properly...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_suite_result_xml" | xpath outfield=testCase "//testSuite/testRunnerResults/testCase" | mvexpand testCase
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;returns a list of these:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;testCase&amp;gt; &amp;lt;startTime&amp;gt;15:45:45&amp;lt;/startTime&amp;gt; &amp;lt;status&amp;gt;FINISHED&amp;lt;/status&amp;gt; &amp;lt;testCaseId&amp;gt;027c9aec-3802-480c-8f5e-637ebcd192d9&amp;lt;/testCaseId&amp;gt; &amp;lt;testCaseName&amp;gt;UC-CR-0010&amp;lt;/testCaseName&amp;gt; &amp;lt;timeTaken&amp;gt;608&amp;lt;/timeTaken&amp;gt; &amp;lt;testStepResults&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 1 [MINT-BE-GetApplicationAndBaseUrl] OK: took 129 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-GetApplicationAndBaseUrl&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;2&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.256&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;129&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 2 [MINT-BE-StartSession] OK: took 237 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-StartSession&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;3&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.445&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;237&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 3 [Transfer_JSessionID] OK: took 4 ms -&amp;gt; Script-result: org.mozilla.javascript.Undefined@689cc181&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;Transfer_JSessionID&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;4&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.726&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;4&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 4 [MINT-BE-GetUser] OK: took 115 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-GetUser&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;5&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.751&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;115&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;result&amp;gt; &amp;lt;message&amp;gt;Step 5 [MINT-BE-EndSession] OK: took 123 ms&amp;lt;/message&amp;gt; &amp;lt;name&amp;gt;MINT-BE-EndSession&amp;lt;/name&amp;gt; &amp;lt;order&amp;gt;6&amp;lt;/order&amp;gt; &amp;lt;started&amp;gt;15:45:45.905&amp;lt;/started&amp;gt; &amp;lt;status&amp;gt;OK&amp;lt;/status&amp;gt; &amp;lt;timeTaken&amp;gt;123&amp;lt;/timeTaken&amp;gt; &amp;lt;/result&amp;gt; &amp;lt;/testStepResults&amp;gt; &amp;lt;failedTestSteps/&amp;gt; &amp;lt;/testCase&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, adding &lt;CODE&gt;xmlkv&lt;/CODE&gt; after and trying to extract the &lt;STRONG&gt;testCaseNames&lt;/STRONG&gt; returns nothing.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_suite_result_xml" | xpath outfield=testCase "//testSuite/testRunnerResults/testCase" | mvexpand testCase | eval _raw=testCase | xmlkv | table testCase.testCaseName
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Nov 2015 20:33:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225053#M44017</guid>
      <dc:creator>dablackgoku1234</dc:creator>
      <dc:date>2015-11-11T20:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is inline conversion of XML string using XMLKV not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225054#M44018</link>
      <description>&lt;P&gt;This should give the testCaseName value &lt;CODE&gt;| xpath .. |  spath input=testcase output=testCaseName path=testCase.testCaseName | table testCaseName&lt;/CODE&gt;or, you could run the spath on the .xml file and skip the xpath command.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2015 23:32:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225054#M44018</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-11-11T23:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is inline conversion of XML string using XMLKV not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225055#M44019</link>
      <description>&lt;P&gt;Thanks.  Apparently, testCaseName did not require any additional spath/xpath, however, it does not work for all fields.  I'm trying to get out the result statuses and I'm getting intermittent results.  When the results are all OK, it returns fine.  But when there are failed results, it does not return anything.  The structures of the XML message are the same.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_suite_result_xml" | xpath outfield=testCase "//testSuite/testRunnerResults/testCase" | mvexpand testCase | eval _raw=testCase | xmlkv | xpath outfield=resultStatus "//testCase/testStepResults/result/status" | table testCaseName, resultStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:49:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-inline-conversion-of-XML-string-using-XMLKV-not-working/m-p/225055#M44019</guid>
      <dc:creator>dablackgoku1234</dc:creator>
      <dc:date>2015-11-17T15:49:24Z</dc:date>
    </item>
  </channel>
</rss>

