<?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 How to fillnull json value pair in a subpath ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548185#M155481</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm faced today with something I do not understand.&lt;/P&gt;&lt;P&gt;Here the structure of my event (JSON structured) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
dateReponse: 1618309228736
dateRequete: 1618309228622
id: 4572d
reponse: {
dossier: [
{
$c: PERSONNE
$i: 1
$l: 1
dateCreation: 1477036197000
dateModification: 1495047526000
id: 1
}
{
$c: IDENTITE
$i: 2
$l: 1
dateCreation: 1477036197000
dateModification: 1513858108603
nom: NOM1
prenom: prenom1
}
{
$c: IDENTITE
$i: 3
$l: 1
dateCreation: 1479206837000
dateModification: 1513858108603
nom: NOM2
}
]
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to fillnum the field reponse.dossier{}.prenom with "unknown" when not present.&lt;/P&gt;&lt;P&gt;The content keep being blank.&lt;/P&gt;&lt;P&gt;I tried adding mvexpand and spath (even if it's already json parsed), no luck.&lt;/P&gt;&lt;P&gt;| mvexpand reponse.dossier{}.nom&lt;BR /&gt;| spath input=reponse.dossier{}&lt;BR /&gt;| fillnull value="unkown" reponse.dossier{}.prenom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding a complete new field after reponse.dossier{}.prenom in the fillnull command, it worked just fine for the new field. Still not for my reponse.dossier{}.prenom.&lt;/P&gt;&lt;P&gt;I think I missed something, somewhere.&lt;/P&gt;&lt;P&gt;Any suggestion ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Ema&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 11:11:40 GMT</pubDate>
    <dc:creator>emallinger</dc:creator>
    <dc:date>2021-04-16T11:11:40Z</dc:date>
    <item>
      <title>How to fillnull json value pair in a subpath ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548185#M155481</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm faced today with something I do not understand.&lt;/P&gt;&lt;P&gt;Here the structure of my event (JSON structured) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
dateReponse: 1618309228736
dateRequete: 1618309228622
id: 4572d
reponse: {
dossier: [
{
$c: PERSONNE
$i: 1
$l: 1
dateCreation: 1477036197000
dateModification: 1495047526000
id: 1
}
{
$c: IDENTITE
$i: 2
$l: 1
dateCreation: 1477036197000
dateModification: 1513858108603
nom: NOM1
prenom: prenom1
}
{
$c: IDENTITE
$i: 3
$l: 1
dateCreation: 1479206837000
dateModification: 1513858108603
nom: NOM2
}
]
}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to fillnum the field reponse.dossier{}.prenom with "unknown" when not present.&lt;/P&gt;&lt;P&gt;The content keep being blank.&lt;/P&gt;&lt;P&gt;I tried adding mvexpand and spath (even if it's already json parsed), no luck.&lt;/P&gt;&lt;P&gt;| mvexpand reponse.dossier{}.nom&lt;BR /&gt;| spath input=reponse.dossier{}&lt;BR /&gt;| fillnull value="unkown" reponse.dossier{}.prenom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried adding a complete new field after reponse.dossier{}.prenom in the fillnull command, it worked just fine for the new field. Still not for my reponse.dossier{}.prenom.&lt;/P&gt;&lt;P&gt;I think I missed something, somewhere.&lt;/P&gt;&lt;P&gt;Any suggestion ?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Ema&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548185#M155481</guid>
      <dc:creator>emallinger</dc:creator>
      <dc:date>2021-04-16T11:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to fillnull json value pair in a subpath ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548192#M155485</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223411"&gt;@emallinger&lt;/a&gt;,&lt;BR /&gt;You need to expand all the child dictionaries in the field&amp;nbsp;&lt;STRONG&gt;dossier&lt;/STRONG&gt;. Try this, here the field name will be &lt;STRONG&gt;prenom&lt;/STRONG&gt; instead of&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;reponse.dossier{}.prenom&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index spurcetype=sourcetype
| rex max_match=0 "(?&amp;lt;event&amp;gt;\{[^\{]+?\})" 
| mvexpand event 
| spath input=event 
| fillnull value="unkown" prenom&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, a like would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:53:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548192#M155485</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-04-16T11:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to fillnull json value pair in a subpath ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548199#M155489</link>
      <description>&lt;P&gt;Hi !&lt;/P&gt;&lt;P&gt;Thank you very much !&lt;/P&gt;&lt;P&gt;Now I just have to integrate this into my whole request, but it'll be fine .&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ema&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:03:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-fillnull-json-value-pair-in-a-subpath/m-p/548199#M155489</guid>
      <dc:creator>emallinger</dc:creator>
      <dc:date>2021-04-16T13:03:06Z</dc:date>
    </item>
  </channel>
</rss>

