5 Replies Latest reply on Oct 25, 2012 8:44 AM by gal sonnenfeld

    ADDM- QUERY to URL

      Share This:

      I have built this query:

       

      SEARCH Host WHERE createdDuring(#, currentTime() - (1 * 864000000000), currentTime()) SHOW name, whenWasThat(creationTime(#)) AS 'Created', host_type PROCESS WITH WHERE (NOT (name HAS SUBSTRING 'lapt' OR name HAS SUBSTRING 'pc')) SHOW name, @1, host_type, #InferredElement:Inference:Primary:DeviceInfo.hostname AS 'Hostname'

       

      Later on, I encoded it using the website: http://www.permadi.com/tutorial/urlEncoding/ and I have got this result:

       

      SEARCH%20Host%20WHERE%20createdDuring%28%23%2C%20currentTime%28%29%20-%20%281%20*%20864000000000%29%2C%20currentTime%28%29%29%20SHOW%20name%2C%20whenWasThat%28creationTime%28%23%29%29%20AS%20%27Created%27%2C%20host_type%20PROCESS%20WITH%20WHERE%20%28NOT%20%28name%20HAS%20SUBSTRING%20%27lapt%27%20OR%20name%20HAS%20SUBSTRING%20%27pc%27%29%29%20SHOW%20name%2C%20@1%2C%20host_type%2C%20%23InferredElement%3AInference%3APrimary%3ADeviceInfo.hostname%20AS%20%27Hostname%27

       

      I changed it a little bit at the beginning and in the end

       

      so it will be URL that show me a file with the result of the addm query:

       

      http://<ServerName>/ui/api/CsvApi?query=SEARCH%20Host%20WHERE%20createdDuring%28%23%2C%20currentTime%28%29%20-%20%281%20*%20864000000000%29%2C%20currentTime%28%29%29%20SHOW%20name%2C%20whenWasThat%28creationTime%28%23%29%29%20AS%20%27Created%27%2C%20host_type%20PROCESS%20WITH%20WHERE%20%28NOT%20%28name%20HAS%20SUBSTRING%20%27lapt%27%20OR%20name%20HAS%20SUBSTRING%20%27pc%27%29%29%20SHOW%20name%2C%20@1%2C%20host_type%2C%20%23InferredElement%3AInference%3APrimary%3ADeviceInfo.hostname%20AS%20%27Hostname%27&username=<UserName>&password=<Password>

       

      But it doesn't work...

       

      I have checked that the query should give me results, and I can get them through the ADDM.

      And when I used this query:

      http://<ServerName>/ui/api/CsvApi?query=SEARCH%20Host&username=<UserName>&password=<Password>

      It did work well.

       

      What did I do wrong? How can I fix it?

       

       

       

      Thank you very much!