How do I gather Bometadata/Immuta query output as a file?

When getting information for a support request from the back end of Immuta. How can I capture the output of the queries in a file for review?

  1. Start by executing into the pod you wish to run the query in, this can be either the Database or Query Engine pods/ containers:

    1. kubectl exec -n <NAMESPACE> -it <prefix>-immuta-database-0 -- psql

  2. Connect to the schema that youre running these queries against (defaults to postgres but can be bometadata or Immuta):

    1. \c bometadata

  3. Then use this to specify where the file will be placed in the pod/ container and the name of it:

    1. \o /tmp/query_output.txt

  4. You can then run your given queries here and the output will be saved to the file specified in the previous step

    1. Note any input and output will be recorded into this file

  5. Exit the database and pod:

    1. \q

  6. Then you can use the formatted command below to copy the file out of the pod and into a directory on your machine:

    1. kubectl -n <NAMESPACE> cp <PREFIX>-immuta-database-0:/tmp/query_output.txt ./query_output.txt

Last updated