<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSON parser extractor name with a &amp;quot;-&amp;quot; in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/248938#M97138</link>
    <description>&lt;P&gt;I have a JSON list (URL&amp;nbsp;&lt;A href="https://ip-ranges.cloud.signiant.com/MediaShuttle" target="_blank"&gt;https://ip-ranges.cloud.signiant.com/MediaShuttle&lt;/A&gt;) with one part of the JSON path name containing a minus sign ("-"):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
    "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"
        ]
    }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the&amp;nbsp;&amp;nbsp;JMESPath tester from jmespath.org, I created an expression that pulls out what I need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; us-east-1.all_ips&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the Minemeld engine will not start, throwing an 'Unknown Character" error, apparently due to the dash.&amp;nbsp; I've tried escaping and quoting using several variations and I cannot create the extractor needed.&amp;nbsp; These are the variations I've tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;us-east-1.all_ips: Unknown Character (the '-')&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips": Unknown Character&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips: Engine won't start&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips[]: Engine won't start&lt;/LI&gt;
&lt;LI&gt;'us-east-1'.all_ips: engine won't start&lt;/LI&gt;
&lt;LI&gt;'us-east-1'.all_ips[].{indicator:@}: engine won't start&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips[].{indicator:@}: engine won't start&lt;/LI&gt;
&lt;LI&gt;us\-east\-1.all_ips[].{indicator:@}: Unknown character&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips"[].{indicator:@}: engine won't start (expected end but found [)&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips[]".{indicator:@}: expected &amp;lt;block end&amp;gt;, but found '&amp;lt;scalar&amp;gt;'&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips[].{indicator:@}": Unknown character&lt;/LI&gt;
&lt;LI&gt;"us\-east\-1.all_ips[].{indicator:@}": engine won't start&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Tue, 05 Feb 2019 20:39:42 GMT</pubDate>
    <dc:creator>MichaelPDean</dc:creator>
    <dc:date>2019-02-05T20:39:42Z</dc:date>
    <item>
      <title>JSON parser extractor name with a "-"</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/248938#M97138</link>
      <description>&lt;P&gt;I have a JSON list (URL&amp;nbsp;&lt;A href="https://ip-ranges.cloud.signiant.com/MediaShuttle" target="_blank"&gt;https://ip-ranges.cloud.signiant.com/MediaShuttle&lt;/A&gt;) with one part of the JSON path name containing a minus sign ("-"):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;{
    "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"
        ]
    }
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using the&amp;nbsp;&amp;nbsp;JMESPath tester from jmespath.org, I created an expression that pulls out what I need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; us-east-1.all_ips&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the Minemeld engine will not start, throwing an 'Unknown Character" error, apparently due to the dash.&amp;nbsp; I've tried escaping and quoting using several variations and I cannot create the extractor needed.&amp;nbsp; These are the variations I've tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;us-east-1.all_ips: Unknown Character (the '-')&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips": Unknown Character&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips: Engine won't start&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips[]: Engine won't start&lt;/LI&gt;
&lt;LI&gt;'us-east-1'.all_ips: engine won't start&lt;/LI&gt;
&lt;LI&gt;'us-east-1'.all_ips[].{indicator:@}: engine won't start&lt;/LI&gt;
&lt;LI&gt;"us-east-1".all_ips[].{indicator:@}: engine won't start&lt;/LI&gt;
&lt;LI&gt;us\-east\-1.all_ips[].{indicator:@}: Unknown character&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips"[].{indicator:@}: engine won't start (expected end but found [)&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips[]".{indicator:@}: expected &amp;lt;block end&amp;gt;, but found '&amp;lt;scalar&amp;gt;'&lt;/LI&gt;
&lt;LI&gt;"us-east-1.all_ips[].{indicator:@}": Unknown character&lt;/LI&gt;
&lt;LI&gt;"us\-east\-1.all_ips[].{indicator:@}": engine won't start&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 20:39:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/248938#M97138</guid>
      <dc:creator>MichaelPDean</dc:creator>
      <dc:date>2019-02-05T20:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parser extractor name with a "-"</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/248990#M97139</link>
      <description>&lt;P&gt;Hi &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/47980"&gt;@MichaelPDean&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this is a tricky one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the right expression is already in your list (&lt;FONT face="courier new,courier"&gt;us-east-1.all_ips[].{indicator:@}&lt;/FONT&gt;)&amp;nbsp; but it must be double escaped .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, &lt;FONT face="courier new,courier"&gt;us-east-1 &lt;/FONT&gt;is not a valid python espression so you must quote it to become&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"us-east-1"&lt;/FONT&gt; . But you can't provide&amp;nbsp;&lt;FONT face="courier new,courier"&gt;extractor: "us-east-1".all_ips[].{indicator:@}&lt;/FONT&gt; 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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you must escape again for the YAML loader to consider the whole line a string scalar. The right value is then:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;extractor: '"us-east-1".all_ips[].{indicator:@}'&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 09:42:02 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/248990#M97139</guid>
      <dc:creator>xhoms</dc:creator>
      <dc:date>2019-02-06T09:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parser extractor name with a "-"</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/249033#M97140</link>
      <description>&lt;P&gt;Thanks, that worked!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 16:01:53 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/249033#M97140</guid>
      <dc:creator>MichaelPDean</dc:creator>
      <dc:date>2019-02-06T16:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: JSON parser extractor name with a "-"</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/460932#M102124</link>
      <description>&lt;P&gt;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).&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 17:34:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/json-parser-extractor-name-with-a-quot-quot/m-p/460932#M102124</guid>
      <dc:creator>joovoo</dc:creator>
      <dc:date>2022-01-25T17:34:33Z</dc:date>
    </item>
  </channel>
</rss>

