<?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 extract fields from child node in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-fields-from-child-node/m-p/541865#M90596</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Splunk extracts the JSON fields automatically if it is well-formed.&amp;nbsp; In this case json fields are starting with leading _ which will be removed by Splunk when automatically extract the fields.&lt;/P&gt;&lt;P&gt;Your fields would be,&lt;/P&gt;&lt;P&gt;content_&lt;/P&gt;&lt;P&gt;hostname_&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;You can use inline regex as following to extract KV pairs in content_ field .&lt;/P&gt;&lt;P&gt;index=test source="test_json"&amp;nbsp; sourcetype="test_new"&lt;BR /&gt;| rex field=content_ "TTY=(?&amp;lt;tty_val&amp;gt;[^;]+);\s+PWD=(?&amp;lt;pwd_val&amp;gt;[^;]+);\s+USER=(?&amp;lt;user_val&amp;gt;[^;]+);\s+COMMAND=(?&amp;lt;command_val&amp;gt;[^;]+)"&lt;BR /&gt;| table tty_val pwd_val user_val command_val&lt;/P&gt;&lt;P&gt;Please note in your case source index and sourcetype differs.&lt;/P&gt;&lt;P&gt;--------------------------------&lt;/P&gt;&lt;P&gt;upvote if it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Mar 2021 23:19:51 GMT</pubDate>
    <dc:creator>venkatasri</dc:creator>
    <dc:date>2021-03-01T23:19:51Z</dc:date>
    <item>
      <title>How to extract fields from child node</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-fields-from-child-node/m-p/540973#M90544</link>
      <description>&lt;P&gt;Deleted&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 08:17:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-fields-from-child-node/m-p/540973#M90544</guid>
      <dc:creator>michael_wong</dc:creator>
      <dc:date>2024-06-21T08:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract fields from child node</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-fields-from-child-node/m-p/541865#M90596</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Splunk extracts the JSON fields automatically if it is well-formed.&amp;nbsp; In this case json fields are starting with leading _ which will be removed by Splunk when automatically extract the fields.&lt;/P&gt;&lt;P&gt;Your fields would be,&lt;/P&gt;&lt;P&gt;content_&lt;/P&gt;&lt;P&gt;hostname_&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;You can use inline regex as following to extract KV pairs in content_ field .&lt;/P&gt;&lt;P&gt;index=test source="test_json"&amp;nbsp; sourcetype="test_new"&lt;BR /&gt;| rex field=content_ "TTY=(?&amp;lt;tty_val&amp;gt;[^;]+);\s+PWD=(?&amp;lt;pwd_val&amp;gt;[^;]+);\s+USER=(?&amp;lt;user_val&amp;gt;[^;]+);\s+COMMAND=(?&amp;lt;command_val&amp;gt;[^;]+)"&lt;BR /&gt;| table tty_val pwd_val user_val command_val&lt;/P&gt;&lt;P&gt;Please note in your case source index and sourcetype differs.&lt;/P&gt;&lt;P&gt;--------------------------------&lt;/P&gt;&lt;P&gt;upvote if it helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 23:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-extract-fields-from-child-node/m-p/541865#M90596</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-03-01T23:19:51Z</dc:date>
    </item>
  </channel>
</rss>

