- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
10-17-2018 06:58 AM - edited 10-17-2018 08:30 AM
I am trying to create a prototype for a Miner that pulls IP's from a JSON formatted file. I have looked at the documentation for setting up a JSON miner (https://live.paloaltonetworks.com/t5/MineMeld-Articles/Using-MineMeld-to-extract-indicators-from-a-g...) and I am having little luck as the error messages in the logs are saying there is a parsing error.
File "/opt/minemeld/engine/0.9.48.post1/local/lib/python2.7/site-packages/minemeld/ft/basepoller.py", line 606, in _polling_loop
ipairs = process_item(item)
File "/opt/minemeld/engine/0.9.48.post1/local/lib/python2.7/site-packages/minemeld/ft/json.py", line 192, in _process_item
indicator = item[self.indicator]
TypeError: string indices must be integers
My Config looks like the following:
age_out:
default: null
interval: 257
sudden_death: true
attributes:
confidence: 100
share_level: green
type: IPv4
extractor: preview_cell_2
indicator: ip_ranges
source_name: aws.S3
url: https://s3.amazonaws.com/okta-ip-ranges/ip_ranges.json
Can anyone assist?
10-26-2018 01:47 AM
Hi @doliver1,
your extractor/indicator combination produces an array of strings instead of an array of objects (you can verify it at http://jmespath.org/)
[ "3.120.18.145/32", "3.120.73.242/32", "3.120.77.98/32", ... ]
You need the extractor to generate an array of objects and tell with the indicator which property in each object inside the extracted array contains the indicator.
Use the extrator "preview_cell_2.ip_ranges[].{indicator:@}" that will produce the following array of objects:
[ { "indicator": "3.120.18.145/32" }, { "indicator": "3.120.73.242/32" }, { "indicator": "3.120.77.98/32" }, ... ]
and use as "indicator" as indicator or just remove it as that is its default value.
10-26-2018 01:47 AM
Hi @doliver1,
your extractor/indicator combination produces an array of strings instead of an array of objects (you can verify it at http://jmespath.org/)
[ "3.120.18.145/32", "3.120.73.242/32", "3.120.77.98/32", ... ]
You need the extractor to generate an array of objects and tell with the indicator which property in each object inside the extracted array contains the indicator.
Use the extrator "preview_cell_2.ip_ranges[].{indicator:@}" that will produce the following array of objects:
[ { "indicator": "3.120.18.145/32" }, { "indicator": "3.120.73.242/32" }, { "indicator": "3.120.77.98/32" }, ... ]
and use as "indicator" as indicator or just remove it as that is its default value.
10-29-2018 09:19 AM
@xhoms thanks for the catch on that. It works perfectly now.
12-04-2018 12:44 AM
Hi Xavier,
I tried to use this as extrator "*.ip_ranges[].{indicator:@}", but the AF minemeld doesnt allow me to click OK. I would like to extract everything from the Okta website.
Regards,
Keng Seng
12-04-2018 01:19 AM
I used the ubuntu VM is working.
age_out |
|
attributes |
|
extractor | *.ip_ranges[].{indicator:@} |
indicator | indicator |
url | https://s3.amazonaws.com/okta-ip-ranges/ip_ranges.json |
12-04-2018 02:12 AM
Hi @KengSeng,
AF-MM has a different UI and may have a different YAML validator. Try quoting the string ("*.ip_ranges[].{indicator:@}"). It should work with that.
12-04-2018 02:52 AM
Thanks Xavier, it works!!!
09-17-2019 05:38 AM - edited 09-17-2019 05:40 AM
("*.ip_ranges[].{indicator:@}") doesnt pull any indicators for me , tried also (*.ip_ranges[].{indicator:@}), same thing I am using VERSION: 0.9.50 and 0.9.52
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!