<?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: How to rename XML field name into shorter name ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40300#M9280</link>
    <description>&lt;P&gt;What i mean is to reduce content_table.table2 to only one field and use it to reference to its children field or its properties.&lt;/P&gt;

&lt;P&gt;For example: &lt;/P&gt;

&lt;P&gt;test:=content_table.table2&lt;/P&gt;

&lt;P&gt;test{@BUSINESS_ENTITY_1} gives a result&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:50:17 GMT</pubDate>
    <dc:creator>sieutruc</dc:creator>
    <dc:date>2020-09-28T12:50:17Z</dc:date>
    <item>
      <title>How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40298#M9278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I get difficult when manipulating XML field name, if i use like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_xml_as" | table content_table.table2{@BUSINESS_ENTITY_1}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It gave me desired result, &lt;/P&gt;

&lt;P&gt;but if i use rename function as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test_xml_as" | rename content_table.table2 as test | table test{@BUSINESS_ENTITY_1}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search hasn't any result. The reason that i want to use rename is to reduce some internal XML field name that are very long.&lt;/P&gt;

&lt;P&gt;So anyone can tell which function i should use to reduce XML field name ?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 13:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40298#M9278</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2012-11-20T13:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40299#M9279</link>
      <description>&lt;P&gt;You can use xpath to take a really long path and simplify it to a single field.&lt;/P&gt;

&lt;P&gt;Try This:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="text_xml_as"|xpath outfield=test "content_table.table2{@BUSINESS_ENTITY_1}"|table test&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Xpath" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Xpath&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 13:45:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40299#M9279</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-11-20T13:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40300#M9280</link>
      <description>&lt;P&gt;What i mean is to reduce content_table.table2 to only one field and use it to reference to its children field or its properties.&lt;/P&gt;

&lt;P&gt;For example: &lt;/P&gt;

&lt;P&gt;test:=content_table.table2&lt;/P&gt;

&lt;P&gt;test{@BUSINESS_ENTITY_1} gives a result&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40300#M9280</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2020-09-28T12:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40301#M9281</link>
      <description>&lt;P&gt;I believe it can be done in same way, but haven't tested it. &lt;CODE&gt;sourcetype=text_xml_as|xpath outfield=test "content_table.table2"|table test{@BUSINESS_ENTITY_1}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2012 15:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40301#M9281</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-11-20T15:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40302#M9282</link>
      <description>&lt;P&gt;i tested it, it doesn't work ,  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;sourcetype=text_xml_as|xpath outfield=test "//content_table/table2"|table test{@BUSINESS_ENTITY_1}&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40302#M9282</guid>
      <dc:creator>sieutruc</dc:creator>
      <dc:date>2020-09-28T12:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to rename XML field name into shorter name ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40303#M9283</link>
      <description>&lt;P&gt;For that you have to use spath...&lt;BR /&gt;
You can spath a specific element, and then with a pipe make a second spath...&lt;/P&gt;

&lt;P&gt;Spath input=input_field output=output_field path="path.to.my.container"  | spath input=ouputfield path=path.into.my.container&lt;/P&gt;

&lt;P&gt;Or simply the second spath without parameter will return all values in fields...&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-rename-XML-field-name-into-shorter-name/m-p/40303#M9283</guid>
      <dc:creator>sbsbb</dc:creator>
      <dc:date>2020-09-28T13:44:28Z</dc:date>
    </item>
  </channel>
</rss>

