<?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: Want to write rex in props to extract field from XML in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682262#M18994</link>
    <description>Is it possible to extract those xml parts 1st and then use xmlkv command to those?</description>
    <pubDate>Thu, 28 Mar 2024 11:12:54 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2024-03-28T11:12:54Z</dc:date>
    <item>
      <title>Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682150#M18970</link>
      <description>&lt;P&gt;I have a mixed data of ADFS logs, mixed in the sense, I have non XML as well as XML formatted data in the same event. Now my requirement is to extract the field from XML format .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Ex:- &amp;lt;abc&amp;gt;WoW&amp;lt;/abc&amp;gt;

        &amp;lt;xyz&amp;gt;SURE&amp;lt;/xyz&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, both the lines are in the same event. I want to have two fields called "abc" and "xyz" with the corresponding value WoW and SURE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly help !!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 18:11:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682150#M18970</guid>
      <dc:creator>abhaywdc</dc:creator>
      <dc:date>2024-03-27T18:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682158#M18972</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;in splunk you can get it like&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw = "Ex:- &amp;lt;abc&amp;gt;WoW&amp;lt;/abc&amp;gt;

        &amp;lt;xyz&amp;gt;SURE&amp;lt;/xyz&amp;gt;"
``` above prepare test event ```
| rex "(?ms)&amp;lt;abc&amp;gt;(?&amp;lt;abc&amp;gt;[^&amp;lt;]+)&amp;lt;\\/abc&amp;gt;.*&amp;lt;xyz&amp;gt;(?&amp;lt;xyz&amp;gt;[^&amp;lt;]+)&amp;lt;\\/xyz&amp;gt;"&lt;/LI-CODE&gt;&lt;P&gt;A nice place to test those is regex101.com. Here is link to your case &lt;A href="https://regex101.com/r/iBvAPm/1" target="_blank"&gt;https://regex101.com/r/iBvAPm/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When you are converting those for Splunk, usually there is need to add some additional escape character as splunk preprocessing that reg ex and remove some \ characters&amp;nbsp;&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 18:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682158#M18972</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-27T18:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682259#M18993</link>
      <description>&lt;P&gt;I appreciate your response here, but there are many xml tags in the event , as I mentioned in the example :&lt;/P&gt;&lt;P&gt;abc&lt;/P&gt;&lt;P&gt;xyz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, you do not know what are the tags coming in the event, so it is dynamic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Field should be created dynamically with the tag's name and the corresponding value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex:- &amp;lt;abc&amp;gt;Wow&amp;lt;/abc&amp;gt;&lt;/P&gt;&lt;P&gt;field name should not be hardcoded as "abc", it should take "abc" dynamically and the value should be "Wow"&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 10:39:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682259#M18993</guid>
      <dc:creator>Abhay</dc:creator>
      <dc:date>2024-03-28T10:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682262#M18994</link>
      <description>Is it possible to extract those xml parts 1st and then use xmlkv command to those?</description>
      <pubDate>Thu, 28 Mar 2024 11:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682262#M18994</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-28T11:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682263#M18995</link>
      <description>&lt;P&gt;We can't use xmlkv, customer will fire the index=indexname sourcetype=soucetypename and data should appear with all the fields extracted !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the events are the combination of Non-XML and XML format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the Non-xml format we have the fields coming in but from the XML formats we dont have any fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, we have to automate the extraction using the props.conf in the backend.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 11:15:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682263#M18995</guid>
      <dc:creator>Abhay</dc:creator>
      <dc:date>2024-03-28T11:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Want to write rex in props to extract field from XML</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682290#M18998</link>
      <description>Can you give any sanitized sample data?&lt;BR /&gt;It's enough that fields are extracted, but not need to index those in ingesting phase?</description>
      <pubDate>Thu, 28 Mar 2024 15:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Want-to-write-rex-in-props-to-extract-field-from-XML/m-p/682290#M18998</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2024-03-28T15:18:50Z</dc:date>
    </item>
  </channel>
</rss>

