- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
02-05-2019 12:39 PM
I have a JSON list (URL https://ip-ranges.cloud.signiant.com/MediaShuttle) with one part of the JSON path name containing a minus sign ("-"):
{ "us-east-1": { "all_ips": [ "3.83.158.71", "3.87.14.184", "34.207.126.66", "34.227.155.76", "34.236.155.245", "52.2.203.56", "52.23.203.179", "52.73.28.78", "52.86.231.134" ] } }
Using the JMESPath tester from jmespath.org, I created an expression that pulls out what I need:
us-east-1.all_ips
However, the Minemeld engine will not start, throwing an 'Unknown Character" error, apparently due to the dash. I've tried escaping and quoting using several variations and I cannot create the extractor needed. These are the variations I've tried:
Thanks in advance,
Mike
02-06-2019 01:37 AM - edited 02-06-2019 01:42 AM
Hi @MichaelPDean,
this is a tricky one.
the right expression is already in your list (us-east-1.all_ips[].{indicator:@}) but it must be double escaped .
First, us-east-1 is not a valid python espression so you must quote it to become "us-east-1" . But you can't provide extractor: "us-east-1".all_ips[].{indicator:@} to the prototype because the YAML loader will fail parsing it due to the first double quote describing the value to be a string scalar and the dot character after the second double quote being considered as an invalid sequence.
So you must escape again for the YAML loader to consider the whole line a string scalar. The right value is then:
extractor: '"us-east-1".all_ips[].{indicator:@}'
02-06-2019 01:37 AM - edited 02-06-2019 01:42 AM
Hi @MichaelPDean,
this is a tricky one.
the right expression is already in your list (us-east-1.all_ips[].{indicator:@}) but it must be double escaped .
First, us-east-1 is not a valid python espression so you must quote it to become "us-east-1" . But you can't provide extractor: "us-east-1".all_ips[].{indicator:@} to the prototype because the YAML loader will fail parsing it due to the first double quote describing the value to be a string scalar and the dot character after the second double quote being considered as an invalid sequence.
So you must escape again for the YAML loader to consider the whole line a string scalar. The right value is then:
extractor: '"us-east-1".all_ips[].{indicator:@}'
01-25-2022 09:34 AM
Thank you both. With this post I was able to decipher part of the syntax for a new miner. I can't seem to find a description of the syntax for the YAML files (as can be found in /opt/minemeld/prototypes/minemeld-node-prototypes/prototypes).
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!