martindstone / pagerduty-cli

A command line interface for PagerDuty
MIT License
91 stars 12 forks source link

Consider adding support to output into newline delimted JSON #51

Open jallan-cflt opened 1 year ago

jallan-cflt commented 1 year ago

One use I am considering is loading the output of the CLI into BigQuery.

BigQuery allows for import of newline delimited JSON. It would be helpful to add an option (--json-nd). Easier to have it built into the tool than to add on a post-processing step.

Thanks in advance for considering!

martindstone commented 1 year ago

Hi @jallan-cflt so are you thinking this would be useful for just the list commands or other stuff too? I don't have any objection to adding it as it seems fairly trivial, especially if it's just for the list commands... it seems odd that BigQuery doesn't understand JSON arrays natively as representing multiple objects?

jallan-cflt commented 1 year ago

I agree that it's odd (I used to be a TPM on the BigQuery team as an FYI).

I have provided similar feedback directly but I not sure how high this ranks for BigQuery to address. I was mainly considering the list events, as my use case is around getting regular data extracts from PagerDuty into a place I can run SQL.