6 Replies Latest reply on Dec 19, 2015 2:15 AM by ben.sunderland

    extract list of users to csv via REST + shell

      So I want to use the REST Api to just list username / email - and get it into CSV.

       

      I wrote shell script that runs curl commands , and uses the pagination links to iterate through each page.

      I end up with the multi-page JSON output saved to a single  file (assuming user count >100).

       

      because I am in Shell , and not Java for example, I didnt want to get in to JSON parsing.

      SO I found jsawk - which looks good to be able to use shell to grab JSON values....

       

      But my output file is not valid ... I am pretty sure I can code around this but massaging the output file into valid JSON, but  I wanted to take stock and check.....

       

      Is there a simpler way to dump ALL users to file using REST ?  Parsing from shell is such a drag - and this should be quite a common request , no ?

       

      My goal was to be able to send a shell script that does this as opposed to a Java App ......

      so customers can modify etc......