<?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 Problem with jq parsing mgmt_cli output. in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243635#M8971</link>
    <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;I'm trying to earn all Non-FQDN (Wildcard) domain from SMS server through CLI.&lt;/P&gt;&lt;P&gt;I'm able to receive all domain by using as example&amp;nbsp;'mgmt_cli -r true show dns-domains details-level full limit 5 --format json'.&lt;/P&gt;&lt;P&gt;But when I try to parse output with jq and filter as example '.objects[].is-sub-domain' I receive next error message ' error: domain is not defined'. Other variations of using this filter and Boolean value have same result ' error: domain is not defined'.&lt;/P&gt;&lt;P&gt;Filters like '.objects[].name' or '.objects[].domain' work fine.&lt;/P&gt;&lt;P&gt;How to do correct parsing?&lt;/P&gt;&lt;P&gt;P.S. Additionally tried old Whitepaper about FQDN objects. Doesn't work too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2025 11:55:40 GMT</pubDate>
    <dc:creator>akurtasanov</dc:creator>
    <dc:date>2025-03-12T11:55:40Z</dc:date>
    <item>
      <title>Problem with jq parsing mgmt_cli output.</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243635#M8971</link>
      <description>&lt;P&gt;Good day.&lt;/P&gt;&lt;P&gt;I'm trying to earn all Non-FQDN (Wildcard) domain from SMS server through CLI.&lt;/P&gt;&lt;P&gt;I'm able to receive all domain by using as example&amp;nbsp;'mgmt_cli -r true show dns-domains details-level full limit 5 --format json'.&lt;/P&gt;&lt;P&gt;But when I try to parse output with jq and filter as example '.objects[].is-sub-domain' I receive next error message ' error: domain is not defined'. Other variations of using this filter and Boolean value have same result ' error: domain is not defined'.&lt;/P&gt;&lt;P&gt;Filters like '.objects[].name' or '.objects[].domain' work fine.&lt;/P&gt;&lt;P&gt;How to do correct parsing?&lt;/P&gt;&lt;P&gt;P.S. Additionally tried old Whitepaper about FQDN objects. Doesn't work too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 11:55:40 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243635#M8971</guid>
      <dc:creator>akurtasanov</dc:creator>
      <dc:date>2025-03-12T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with jq parsing mgmt_cli output.</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243673#M8974</link>
      <description>&lt;P&gt;I believe that you need to add the &lt;EM&gt;&lt;STRONG&gt;is-sub-domain&lt;/STRONG&gt;&amp;nbsp;&lt;/EM&gt;in quotes as well as adding &lt;STRONG&gt;&lt;EM&gt;details-level full&lt;/EM&gt;&lt;/STRONG&gt; to your mgmt_cli command.&lt;/P&gt;
&lt;PRE&gt;[Expert@mgmt2:0]# mgmt_cli -r true show dns-domains -f json details-level full| jq -r &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;'.objects[]|."is-sub-domain"'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;true&lt;BR /&gt;false&lt;/PRE&gt;
&lt;PRE&gt;&amp;nbsp;[Expert@mgmt2:0]# mgmt_cli -r true show dns-domains -f json details-level full| jq -r '.objects[]|[.name,."is-sub-domain"]'&lt;BR /&gt;[&lt;BR /&gt;".corp.example2.com",&lt;BR /&gt;true&lt;BR /&gt;]&lt;BR /&gt;[&lt;BR /&gt;".www.example.com",&lt;BR /&gt;false&lt;BR /&gt;]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 18:45:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243673#M8974</guid>
      <dc:creator>masher</dc:creator>
      <dc:date>2025-03-12T18:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with jq parsing mgmt_cli output.</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243758#M8975</link>
      <description>&lt;P&gt;Interesting.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Will try.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 16:31:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243758#M8975</guid>
      <dc:creator>akurtasanov</dc:creator>
      <dc:date>2025-03-13T16:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with jq parsing mgmt_cli output.</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243767#M8976</link>
      <description>&lt;P&gt;This is the biggest headache with using the management API via mgmt_cli. At least 60% of the keys have dashes in them, and jq makes you quote keys which contain dashes.&lt;/P&gt;
&lt;P&gt;Separately, jq has the ability to extract objects which match a given predicate using the 'select' command, like so:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@DallasSC]# mgmt_cli -f json -r true show dns-domains details-level full limit 500 offset 0 | jq -c '.objects[]|select(."is-sub-domain" == false)|.'
{"uid":"00112233-4455-6677-8899-aabbccddeeff","name":".core.windows.net","type":"dns-domain","domain":{...},"is-sub-domain":true,"comments":"","color":"black","icon":"Objects/domain","tags":[],"meta-info":{"lock":"unlocked","validation-state":"ok","last-modify-time":{"posix":"[...]","iso-8601":"[...]"},"last-modifier":"[...]","creation-time":{"posix":"[...]","iso-8601":"[...]"},"creator":"[...]"},"read-only":false,"available-actions":{"edit":"true","delete":"true","clone":"true"}}
...&lt;/LI-CODE&gt;
&lt;P&gt;Once you have the objects, you can carve them up for display any way you want by just replacing that last dot.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 19:22:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243767#M8976</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-03-13T19:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with jq parsing mgmt_cli output.</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243785#M8977</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 05:10:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Problem-with-jq-parsing-mgmt-cli-output/m-p/243785#M8977</guid>
      <dc:creator>akurtasanov</dc:creator>
      <dc:date>2025-03-14T05:10:10Z</dc:date>
    </item>
  </channel>
</rss>

