-
I'm trying to create a custom parser bot for Crowdstrike data collected. I'm facing the following issue : I suppose there are duplicate hash (or other fields) in the feed I'm collecting.
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
You cannot set a key if they key already exists without explicitly overwriting it. Use |
Beta Was this translation helpful? Give feedback.
-
Will it erase each new value and at the end I'll have only the last one ? |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
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.
I implement |
Beta Was this translation helpful? Give feedback.
-
And each "document" will become its own event? If every document has its own hash, there will be no conflicts.
We don't know your bot code. |
Beta Was this translation helpful? Give feedback.
-
I used this bot https://github.com/certtools/intelmq/blob/develop/intelmq/bots/parsers/cznic/parser_proki.py as a "template". Maybe you can have more context with this. I should send it before... |
Beta Was this translation helpful? Give feedback.
I don't have the input data, so it's again a guess.
raw_json["resources"]
appears to be a list not a dict of lists. Thus, in each loop iterationevent
already has some data.Try moving the
event =
andyield event
inside the loop.