Retrieve App Logs from Stackato Client

The stackato client is used for interacting with the system from the command line.

  1. Download the client for your platform (Windows, OS X, Linux x86, Linux x64)
  2. Unzip the archive in a convenient directory.
  3. Add the the executable to your system/shell $PATH by:
    1. moving it to a directory in your $PATH,
    2. creating a symlink from a directory in your $PATH, or
    3. creating a shell alias for the executable.
  4. Confirm that the client is installed correctly by running stackato -v or stackato help.

To connect the stackato client from you favorite command line interface, you will need to specify the API Endpoint, which is the hostname prepended with “api.”: api.stackato-pry5.local

Target and Login

PS C:\stackato> stackato target api.stackato-pry5.local
Successfully targeted to [https://api.stackato-pry5.local]
PS C:\stackato> stackato login
Attempting login to [https://api.stackato-pry5.local]
Email: <your email account>@foobar.com
Password: ******************
Successfully logged into [https://api.stackato-pry5.local]
Reset current group: OK

Group and Apps

PS C:\stackato> stackato group f5qa
Successfully set current group to [f5qa]
PS C:\stackato> stackato appsstackatoclient

Stackato Logs

To view and application log stream, use the stackato logs command:

PS C:\stackato> stackato logs [myapp]
PS C:\stackato> stackato logs f5qarc4-console

To limit the number of lines displayed, use the –num option:

PS C:\stackato> stackato logs [myapp] –num 50
To view log stream as it is updated, use the –follow option:

PS C:\stackato> stackato logs [myapp] –follow

Note stackato logs buffers only 400 lines of the log stream history (i.e. lines generated prior to it being run). If you need earlier log lines, use the stackato files command to fetch the relevant log file from the logs/ directory

You can save whatever you get to your local machine by using redirection operators:

PS C:\stackato> stackato logs f5qarc4-relay –num 50 >> relaylog01.txt
PS C:\stackato> stackato logs f5qarc4-relay –follow

Stackato Files

PS C:\stackato> stackato files [appname] [path] [–all]

PS C:\stackato> stackato files f5qarc4-relay /logs
staging.log 16B
stderr.log 1.4K
stdout.log 67.9M
stdout.log.1.gz 6.8M
stdout.log.2.gz 6.9M
stdout.log.3.gz 7.0M
stdout.log.4.gz 7.0M
stdout.log.5.gz 8.4M
stdout.log.6.gz 7.3M
stdout.log.7.gz 7.4M
stdout.log.8.gz 7.4M
stdout.log.9.gz 8.8M
PS C:\stackato> stackato files f5qarc4-relay /logs/stderr.log >> relay-stderr.log
PS C:\stackato>

Connect MySQL database on Stackato with Toad

Assume you have connected to Stackato:

PS C:\> stackato target api.<hostname>
Successfully targeted to [https://api.<hostname>]
PS C:\> stackato login
Attempting login to [https://api.<hostname>]
Email: <your email>
Password: ******************
Successfully logged into [https://api.<hostname>]
Reset current group: OK
PS C:\> stackato group <your group>
Successfully set current group to [<your group>]

Run these commands to get access information to MySQL database:

PS C:\> stackato tunnel
1. f5qa-mysql
2. f5qa-push-mysql
Which service to tunnel to: 1
Getting tunnel url: OK, at https://tunnel-f6667.<hostname>
Getting tunnel connection info: OK

Service connection info:
+----------+-----------------------------------+
| Key      | Value                             |
+----------+-----------------------------------+
| username | usIUyNnvRnrCN                     |
| password | pKRr7Iz9n03dH                     |
| name     | d15ffa8be6e6c4e189bed3a0cf06a08be |
+----------+-----------------------------------+

1. none
2. mysql
3. mysqldump
Which client would you like to start? 1
Starting tunnel to -mysql on port 10000.
Open another shell to run command-line clients or
use a UI tool to connect using the displayed information.
Press Ctrl-C to exit...

Now open Toad for MySQL.
Go to Menu/File/New/Connection and provide the information:

Login:
Connection Type: TCP
Host: localhost
User: usIUyNnvRnrCN
Password: •••••••••••••
Database: <leave it blank>
Port: 10000

Name: d15ffa8be6e6c4e189bed3a0cf06a08be

Then click Connect button.
2013-05-09_10h50_21