Sign inSign up

asyncy/logstreamer

By asyncy

•Updated almost 7 years ago

Image
0

2.2K

asyncy/logstreamer repository overview

⁠Logstash Streamer

The logging endpoint for the Storyscript Cloud.

⁠Client WebSocket API

⁠Authentication

Once a connection has been established to the endpoint, the client must authenticate itself within 10 seconds. If this an authentication message is not received, the connection will be closed.

The authentication payload should look like the following:

{
  "command": "auth",
  "access_token": "your access token",
  "app_id": "your app id",
  "id": "your id (corresponds to owner_uuid)"  
}

Once this message is received, the server will authenticate and authorise your connection. After a successful authorisation, the following message is sent:

{
  "authorised": true
}

If authorisation fails, the connection will be terminated immediately.

⁠Staying connected

In order for the server to reliably know that the client is connected, a ping request must be at least once in 30 seconds. The recommended interval is 25 seconds.

The payload looks like:

{
  "command": "ping"
}

⁠Request for logs

After a the authentication message is confirmed, a request for logs may be sent.

⁠Runtime

To retrieve logs from the runtime (Storyscript runtime), send the following message:

{
  "command": "filter",
  "source": "runtime",
  "level": "debug/info/warn/error",
  "n": 100,
  "watch": true 
}
  • n indicates how many lines before the current moment must be sent (equivalent to tail -n)
  • watch indicates that in addition to sending the last n lines of logs, continue sending out logs in real time
⁠Service

To retrieve logs that belong to a service, the following payload may be sent:

{
  "command": "filter",
  "source": "service",
  "service_name": "redis",
  "level": "debug/info/warn/error",
  "n": 100,
  "watch": true  
}
  • level is currently ignored
  • n and watch have the same meaning as previously stated
  • service_name is the name of the service (either an alias such as redis, or fully qualified such as your_name/service)
⁠Additional notes

More than one filter commands may be sent, which will result in multiple log messages being received.

Tag summary

Content type

Image

Digest

Size

295.1 MB

Last updated

about 7 years ago

docker pull asyncy/logstreamer