You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I fixed the issue,There is no problem with json-c.
After calling json_object_object_add(rules_list,rule_id_as_key,rule),
I was calling json_object_object_put(rule); [As json-c is new for me].
Hi,
I'm trying to update json object with key but it's not taking new value:-
Current json string is like[rules_list] :-
{
"324981": { "_id": 324981, "description": "Creating event Alert", "category": "Category Of the threat", "severity": 1,
"alert": { "enabled": false }, "mail": { "enabled": false, "to": "chirxxxxx_dey@outlook.com" }, "syslog": { "enabled": true },
"keyword": "hello*world", "condition": { "all": [ { "fact": "ip.src_city", "operator": "contains", "value": "mumba" } ] } }
}
rule_id_as_key="324981"
rule :-
json_object_object_del(rules_list,rule_id_as_key);
json_object_object_add(rules_list,rule_id_as_key,rule);
Then After[rules_list] :-
{
"324981":""
}
The text was updated successfully, but these errors were encountered: