Hitachi Content Platform​

 View Only

 JSON Input (8.3) unable to read a flattened json

  • Object Storage
  • Hitachi Content Platform HCP
jozsef basa's profile image
jozsef basa posted 02-06-2020 18:55

Hi

 

Please help

 

I have a very basic json structure with nested object which is correctly parsed by JSON Input step:

 

{

"_id": "1321312324234",

"_source": {

   "name": "Basa",

   "address": {

      "city": "Budapest",

      "district": "Kispest"

      }

   }

}

 

 

 

Unfortunately the same json structure somehow flattened in Elasticsearch result like this:

 

{

"_id": "1321312324234",

"_source": {

   "name": "Basa",

   "address.city": "Budapest",

   "address.district": "Kispest"

   }

}

 

And the step cannot handle this. How can I solve this problem

 

Thanks

Jozsef


#HitachiContentPlatformHCP
Sergio Ribeiro's profile image
Sergio Ribeiro

Hi @jozsef basa​,

 

You're probably using a JSONPath like this: $._source.address.city

Try $._source.['address.city'] instead!

 

Regards,

 

Sérgio Ribeiro

Porto - Portugal

 

jozsef basa's profile image
jozsef basa

Hi Sergio

 

It works

 

Thanks

Jozsef

Jiri Lokaj's profile image
Jiri Lokaj

Hello guys,

 

I can not create new question, so due to this I have to paste it here as reply.

 

In JSON input step there is known bug, Select fields doesn't work automatically (in version 8.3).

 

I received an information in version 9 should be this bug corrected.

 

 

 

when I press Select fields nothing happened. Just error message Unable to view JSON fields. why?

 

 

I do not want to specify each field manually it is impossible.

 

Thank you for your clarification!

 

Jiri