Hi Anil,

the easiest way to define a map in the Stellar language is to define it via
a variable assignment in a JSON format.


   - For example, below I define a map called kafka_props.
   - Then, with "*MAP_EXISTS*" I check if the map ( => JSON object) has a
   key "security.protocol", which it has
   - Then I try to extract the value of the key "security.protocol" and get
   the correct value of "SASL_PLAINTEXT".


[Stellar]>>> kafka_props := { "bootstrap.servers": "
condla1.field.hortonworks.com:6667", "security.protocol": "SASL_PLAINTEXT"}
{security.protocol=SASL_PLAINTEXT, bootstrap.servers=
condla1.field.hortonworks.com:6667}

[Stellar]>>> MAP_EXISTS("security.protocol", kafka_props)
true

[Stellar]>>> MAP_GET("security.protocol", kafka_props)
SASL_PLAINTEXT

As of now, I don't think there is a MAP_PUT .  In most of the Metron use
cases, the map is either the incoming message or an external enrichment and
you use MAP_GET to extract information from it.

Does this answer your question?

Best,
Stefan


On Fri, Jan 4, 2019 at 12:26 PM Anil Donthireddy <[email protected]>
wrote:

> Hi,
>
>
>
> I have gone through the stellar documentation to understand how to store
> key/value pairs in to an stellar object. I can see there are functions
> MAP_EXISTS() and MAP_GET() that do operations on key/value pairs.
>
>
>
> But I am unable to find how to initialize MAP object and add/update
> key/value pairs in the MAP. Please help to store key/value pairs in stellar
> object.
>
>
>
> Thanks,
>
> Anil.
>

Reply via email to