<?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: Removing Single Fields From a List of Maps in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540611#M152950</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 |fields _raw
| eval _raw="{\"stages\":[{\"duration\":12,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"failed\"}]},{\"duration\":1.5,\"status\":\"Success\",\"children\":[{\"test\":\"unit\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"passed\"}]},{\"duration\":3.1,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"unit\",\"result\":\"failed\"}]}]}"
| spath stages{} output=stages
| stats count by stages
| streamstats count as session
| spath input=stages children{} output=child
| spath input=stages duration
| spath input=stages status
| stats values(duration) as duration values(status) as status by session child
| spath input=child
| fields - session child&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can make a table with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 |fields _raw
| eval _raw="{\"stages\":[{\"duration\":12,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"failed\"}]},{\"duration\":1.5,\"status\":\"Success\",\"children\":[{\"test\":\"unit\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"passed\"}]},{\"duration\":3.1,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"unit\",\"result\":\"failed\"}]}]}"
| rex mode=sed "s/children\":\[.*?\]/children\":[]/g"&lt;/LI-CODE&gt;&lt;P&gt;If you want to delete it, try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2021 01:58:27 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2021-02-20T01:58:27Z</dc:date>
    <item>
      <title>Removing Single Fields From a List of Maps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540594#M152944</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an event json similar to:&lt;BR /&gt;&lt;BR /&gt;{"stages":[{"duration":12,"status":"Success","children":[{"test":"integration","result":"passed"},{"test":"regression","result":"failed"}]},{"duration":1.5,"status":"Success","children":[{"test":"unit","result":"passed"},{"test":"regression","result":"passed"}]},{"duration":3.1,"status":"Success","children":[{"test":"integration","result":"passed"},{"test":"unit","result":"failed"}]}]}&lt;/P&gt;&lt;P&gt;where children is a list of maps inside a list of maps.&amp;nbsp; The problem is that this list is so large that it exceeds the 10000 character limit.&amp;nbsp; I don't have admin access so cannot increase this limit.&amp;nbsp; What I would like to is remove the children field inside of each map in the stages list.&amp;nbsp; I've tried numerous attempts without any luck.&amp;nbsp; Anyone know of a way to do this?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 22:57:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540594#M152944</guid>
      <dc:creator>steeleverint</dc:creator>
      <dc:date>2021-02-19T22:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Single Fields From a List of Maps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540611#M152950</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 |fields _raw
| eval _raw="{\"stages\":[{\"duration\":12,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"failed\"}]},{\"duration\":1.5,\"status\":\"Success\",\"children\":[{\"test\":\"unit\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"passed\"}]},{\"duration\":3.1,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"unit\",\"result\":\"failed\"}]}]}"
| spath stages{} output=stages
| stats count by stages
| streamstats count as session
| spath input=stages children{} output=child
| spath input=stages duration
| spath input=stages status
| stats values(duration) as duration values(status) as status by session child
| spath input=child
| fields - session child&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can make a table with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 |fields _raw
| eval _raw="{\"stages\":[{\"duration\":12,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"failed\"}]},{\"duration\":1.5,\"status\":\"Success\",\"children\":[{\"test\":\"unit\",\"result\":\"passed\"},{\"test\":\"regression\",\"result\":\"passed\"}]},{\"duration\":3.1,\"status\":\"Success\",\"children\":[{\"test\":\"integration\",\"result\":\"passed\"},{\"test\":\"unit\",\"result\":\"failed\"}]}]}"
| rex mode=sed "s/children\":\[.*?\]/children\":[]/g"&lt;/LI-CODE&gt;&lt;P&gt;If you want to delete it, try this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 01:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540611#M152950</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-02-20T01:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Removing Single Fields From a List of Maps</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540925#M153094</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; That did the trick.&amp;nbsp; Just did a slight modification to remove the field altogether:&lt;BR /&gt;&lt;BR /&gt;rex mode=sed "s/\"children\":\[.*?\],//g"&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 23:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Removing-Single-Fields-From-a-List-of-Maps/m-p/540925#M153094</guid>
      <dc:creator>steeleverint</dc:creator>
      <dc:date>2021-02-22T23:36:14Z</dc:date>
    </item>
  </channel>
</rss>

