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?
Start by executing into the pod you wish to run the query in, this can be either the Database or Query Engine pods/ containers:
kubectl exec -n <NAMESPACE> -it <prefix>-immuta-database-0 -- psql
Connect to the schema that youre running these queries against (defaults to postgres but can be bometadata or Immuta):
\c bometadata
Then use this to specify where the file will be placed in the pod/ container and the name of it:
\o /tmp/query_output.txt
You can then run your given queries here and the output will be saved to the file specified in the previous step
Note any input and output will be recorded into this file
Exit the database and pod:
\q
Then you can use the formatted command below to copy the file out of the pod and into a directory on your machine:
kubectl -n <NAMESPACE> cp <PREFIX>-immuta-database-0:/tmp/query_output.txt ./query_output.txt
Last updated