Closed vandaref closed 9 months ago
You cannot set a key if they key already exists without explicitly overwriting it. Use event.add(key, value, overwrite=True)
instead.
https://intelmq.readthedocs.io/en/develop/source/intelmq.lib.html#intelmq.lib.message.Message.add
Will it erase each new value and at the end I'll have only the last one ?
Yes, each key can only have one value. It's a dictionary. https://docs.intelmq.org/latest/user/event/#fields-reference lists all fields and their type.
If you need to write lists, you can use a custom field in the extra.
namespace. They can have any type.
But each event is different. I don't have this issue with other bot. The hash of each document will be different. So the key already exists with an other value.
Please see this example :
{
"id": "hash_md5_58a5bdcf325429d36194202544359f22",
"indicator": "58a5bdcf325429d36194202544359f22",
"type": "hash_md5",
"deleted": false,
"published_date": 1364395570,
"last_updated": 1707145213,
...,
],
"vulnerabilities": []
},
{
"id": "hash_md5_ad7eacf53192afdce79b951ba860d3d3",
"indicator": "ad7eacf53192afdce79b951ba860d3d3",
"type": "hash_md5",
"deleted": false,
"published_date": 1378907777,
"last_updated": 1707145213,
..,
"vulnerabilities": []
}
I implement indicator
value as malware.hash.XXX
key. I'm not sure to understand because on other bot this is the same schema we have different value for one key.
But each event is different. I don't have this issue with other bot. The hash of each document will be different.
And each "document" will become its own event? If every document has its own hash, there will be no conflicts.
I implement
indicator
value asmalware.hash.XXX
key. I'm not sure to understand because on other bot this is the same schema we have different value for one key.
We don't know your bot code.
I'm trying to create a custom parser bot for Crowdstrike data collected.
I'm facing the following issue :
intelmq.lib.exceptions.KeyExists: key 'malware.hash.sha256' already exists
and it could happens with others fields than malware.hash.sha256.I suppose there are duplicate hash (or other fields) in the feed I'm collecting. This is the output of my debug :