cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JSON output parameter results in command not found

Jump to solution

I'm attempting to pull down a report in JSON format, but appending the required parameter fails:

:output=json: command not found

 Query is being done from CLI using cURL against the following URL:

https://<server FQDN>:<port>/remote/core.executeQuery?queryId=<queryID>&:output=json

Any guidance on what I'm missing?

1 Solution

Accepted Solutions

Re: JSON output parameter results in command not found

Jump to solution

It worked in Chrome and that provided a hint of the problem. When using cURL, you have to encode the parameter for it to work.

curl -G -k -u <user>:<pass> https://<server>:<port>/remote/core.executeQuery --data-urlencode "queryId=<query ID>" --data-urlencode ":output=json"

Thanks for the help figuring it out! 

View solution in original post

5 Replies
cdinet
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 6

Re: JSON output parameter results in command not found

Jump to solution

If you use this url, do you still get command not found?

https://localhost:8443/remote/core.help?:output=json

Additionally, the command is case sensitive, so make sure the case is correct in your string.

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

Re: JSON output parameter results in command not found

Jump to solution

I get JSON output for core.help, command not found when using cURL from the command line. A couple of minutes after I'm dumped back to the command prompt, I get the report output in verbose format.

cdinet
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 4 of 6

Re: JSON output parameter results in command not found

Jump to solution

Can you try the command in the browser starting with just the https url and not using curl?

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

Re: JSON output parameter results in command not found

Jump to solution

It worked in Chrome and that provided a hint of the problem. When using cURL, you have to encode the parameter for it to work.

curl -G -k -u <user>:<pass> https://<server>:<port>/remote/core.executeQuery --data-urlencode "queryId=<query ID>" --data-urlencode ":output=json"

Thanks for the help figuring it out! 

View solution in original post

cdinet
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 6 of 6

Re: JSON output parameter results in command not found

Jump to solution

Glad you got it to work!

Was my reply helpful?
If this information was helpful in any way or answered your question, will you please select Accept as Solution in my reply and together we can help other members?

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community