This document will walk you through the few steps needed to access your log archive in a more direct, searchable manner compared to the summary view in your cloud portal UI. Overall, you will first have to install a CLI from our hosting partner, Aiven, connect to your database, and then dump the logs to a text file.


1.0 Connecting to the CLI

To access your account information via the CLI you need to take the following steps:

  1. Login to your Timescale Cloud Portal 

  2. Click on your user name in the top left corner

  3. Select the Authentication tab 

  4. Click Generate Token:

  5. Name the token CLI, and leave the rest blank

  6. Copy the token. You need to grab it on this screen, otherwise it is gone

  7. Paste it somewhere safe

Now you have the needed access token.

2.0 Install the Aiven CLI Client:  

python -m pip install aiven-client

NOTE: You will need python 2.7 or 3.4 installed installed on the box you are using.

Next, create the following directory:

  ~/.config/aiven/

And create the following file:  

 aiven-credentials.json 

Within that file, insert the following:

{
    "auth_token": "ABC1+123...TOKEN==",
    "user_email": "[email protected]"
}

Copy and paste the token we generated earlier between the quotes on the auth_token line and add your email address (of your account) on the user_email line.

Finally, save and close the file.

3.0 Confirm you have access to your cloud account

Now you should be able to test that you can access the account using a simple command:

avn project list

This should show you a list of projects and the clouds they reside on.

4.0 Dump your logs

Once you have confirmed that you are able to access the account using this command test, now we can dump your logs.

avn service logs -S desc -f --project <project name> <service_name> > tslogs.txt

NOTE: This function will pipe the logs to a text file. You can also pipe to an archive like a tar file if the logs are too large.  You can then open these in a text editor or another external program that will allow you to parse the logs via search and timestamp.

Did this answer your question?