Conversation
93c7b4c to
35ff026
Compare
docs/user/bots.rst
Outdated
There was a problem hiding this comment.
What if the data is in json["data.ipdata"]?
There was a problem hiding this comment.
it will still work. if we have both json["data"]["ipdata"] and json["data.ipdata"], the one which is later defined, will override the other and its value will be assigned in key "data.ipdata" of flattened json.
There was a problem hiding this comment.
If json_data_key can only be used in conjunction with json_data_format, why use two different parameters?
ghost
left a comment
There was a problem hiding this comment.
Thanks for the contribution! That's definitely a long-awaited parser :)
I only had a look at the added documentation so far.
docs/user/bots.rst
Outdated
There was a problem hiding this comment.
Please expand the explanation, examples are also helpful.
There was a problem hiding this comment.
json_data_format will be True if there is a single json and list of data is inside any of its child nodes. For below json, we find data inside key 'data'
{ "complete": false, "count": 9632240, "data": [ { "ip": "179.124.36.196", "classification": "malicious", "first_seen": "2020-01-13", "last_seen": "2020-12-14", "tags": [ "SSH Scanner", "SSH Worm" ], "cve": [] }, { "ip": "189.86.227.150", "classification": "malicious", "first_seen": "2019-01-17", "last_seen": "2020-12-14", "tags": [ "Eternalblue", "SMB Scanner" ], "cve": [ "CVE-2017-0144" ] } ], "message": "ok" }
There was a problem hiding this comment.
Can you please add that example to the docs?
docs/user/bots.rst
Outdated
There was a problem hiding this comment.
Please expand the explanation, examples are also helpful.
There was a problem hiding this comment.
Again in above json, if we have config json_data_key: data and json_data_format : True, it will create two event with list of data present in json["data"] with proper harmonized field as per given in translate_field parameter.
There was a problem hiding this comment.
Why are json_data_format and splitlines mutually exclusive?
Btw, I think there's no test that covers actual line splitting (the tests with splitlines=true only have one line)
|
Hi, thanks a lot for your contribution! That looks like a very useful parser. Could you make your commit messages a bit more verbose? It would be great if the information you added in the pull request would be part of the commit message, i.e. and for the documentation commit (if you want to keep that separate - you could also simply squash to one commit!) Also there are a lot of unnecessary changes in the |
JSON Custom Parser allows can translate json key into harmonized key field and can create events from list of dict within key of JSON
|
Hi, all requested changes have been made in previous commit. |
| with open(os.path.join(os.path.dirname(__file__), 'multiple_msg.json'), 'rb') as fh: | ||
| RAW1 = base64.b64encode(fh.read()).decode() | ||
|
|
||
| MULTILINE_REPORT = {"feed.name": "RSTThreats Domain Feed", |
There was a problem hiding this comment.
That bot is actually on the whishlist, so if you can contribute an entry to feeds.yaml that would be nice :)
This parser can translate json key into harmonized key field and can create events from list of dict within key of JSON.