
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
logstream
Advanced tools
Logstream is an Acquia service for streaming logs from Acquia Cloud. It supports streaming a variety of log sources:
This repository contains a client-side library and CLI. Acquia Cloud provides a browser-based UI as well.
$HOME/.acquia/cloudapiv2.conf . This file is in JSON format with api_key and api_secret defined.{
"api_key" : "key",
"api_secret" : "secret"
}
$ gem install logstream
Find the UUID of the application you would like to stream logs for. Documentation on how to find applicaiton UUID can be found here
Stream logs from the production environment:
$ logstream tail 55ea1945-4aa6-4c56-bb7b-2108565e22d6 prod
127.0.0.1 - - [11/Jun/2014:17:28:47 +0000] "GET / HTTP/1.1" 200 7708 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36" http_host=mysite.com affinity="-" upstream_addr="10.218.29.150:80" hosting_site=mysite request_time=0.030 forwarded_for="64.80.128.4" upstream_status="200"
... etc ...
A variety of filtering and display options are available:
$ logstream help tail
Logstream communicates over TCP using the WebSocket protocol. Use the logstream Cloud API call to retrieve the URL to connect to and an authenticated message to initial streaming for a particular Cloud environment.
Messages use text data frames, and contain JSON-encoded hashes. Each message contains a key 'cmd' which specifies the action to perform, and defines the other elements of the hash.
Available commands are defined in the following subsections. Inbound commands can arrive from the upstream client (end-user client, or an upstream logtailor). Outbound commands are sent to the upstream client.
In the examples that follow, "<-" indicates and inbound command and "->" indicates an outbound command. Those indicators are merely documentation for the examples; they are not part of the API.
The logstream CLI --debug option shows API messages as they occur. Here is hypothetical debug output for the Dev environment of a site named "mysite" up to the first actual log message arriving. By default, the CLI enables the log types apache-request, php-error, drupal-watchdog, and varnish-request.
$ logstream tail 55ea1945-4aa6-4c56-bb7b-2108565e22d6 dev --debug
-> connect to wss://logstream.acquia.com/ah_websocket/logstream/v1
-> {"site":"devcloud:mysite","d":"deaefc1f42a4d18cb932c2eb9fa75115fba5ab83f1a3c564767ef1ce8dabf2cc","t":1404764927,"env":"dev","cmd":"stream-environment"}
<- {"cmd":"connected","server":"logstream-api-61"}
<- {"cmd":"connected","server":"bal-4"}
<- {"type":"bal-request","cmd":"available","server":"bal-4","display_type":"Balancer request"}
<- {"type":"varnish-request","cmd":"available","server":"bal-4","display_type":"Varnish request"}
-> {"cmd":"enable","type":"varnish-request","server":"bal-4"}
<- {"server":"srv-6","cmd":"connected"}
<- {"display_type":"Apache request","server":"srv-6","cmd":"available","type":"apache-request"}
-> {"cmd":"enable","type":"apache-request","server":"srv-6"}
<- {"display_type":"Apache error","server":"srv-6","cmd":"available","type":"apache-error"}
<- {"display_type":"PHP error","server":"srv-6","cmd":"available","type":"php-error"}
-> {"cmd":"enable","type":"php-error","server":"srv-6"}
<- {"display_type":"Drupal watchdog","server":"srv-6","cmd":"available","type":"drupal-watchdog"}
-> {"cmd":"enable","type":"drupal-watchdog","server":"srv-6"}
<- {"display_type":"Drupal request","server":"srv-6","cmd":"available","type":"drupal-request"}
<- {"server":"bal-5","cmd":"connected"}
<- {"msg":{"type":"varnish-request","server":"bal-4","cmd":"enable"},"cmd":"success","server":"bal-4"}
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"apache-request"}}
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"php-error"}}
<- {"server":"srv-6","cmd":"success","msg":{"server":"srv-6","cmd":"enable","type":"drupal-watchdog"}}
<- {"server":"bal-5","display_type":"Balancer request","cmd":"available","type":"bal-request"}
<- {"server":"bal-5","display_type":"Varnish request","cmd":"available","type":"varnish-request"}
-> {"cmd":"enable","type":"varnish-request","server":"bal-5"}
<- {"server":"bal-5","cmd":"success","msg":{"server":"bal-5","type":"varnish-request","cmd":"enable"}}
<- {"text":"107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] \"GET / HTTP/1.0\" 200 2454 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\" vhost=mysitedev.devcloud.acquia-sites.com host=mysitedev.devcloud.acquia-sites.com hosting_site=mysitedev pid=6863 request_time=80001 request_id=\"v-4fe9953a-0615-11e4-9fd8-1231392c7b9c\"","server":"srv-6","cmd":"line","http_status":200,"log_type":"apache-request","disp_time":"2014-07-07 20:28:53"}
107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] "GET / HTTP/1.0" 200 2454 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36" vhost=eebjaspandev.devcloud.acquia-sites.com host=eebjaspandev.devcloud.acquia-sites.com hosting_site=eebjaspandev pid=6863 request_time=80001 request_id="v-4fe9953a-0615-11e4-9fd8-1231392c7b9c"
Sent by a variety of commands when a triggering command is completed successfully (failures result in an error command). Since some commands execute on multiple servers, a single command may generate multiple success replies.
Parameters:
Example:
<- {"cmd":"success","msg":{"type":"varnish-request","server":"bal-4","cmd":"enable"},"server":"bal-4"}
Sent when an error occurs, either because of a bad request or any kind of system or network failure. Since some commands execute on multiple servers, a single command may generate multiple error replies.
Parameters:
Example:
<- {"cmd"=>"error", "during"=>"{\"description\":\"this is an invalid message\"}", "description"=>"message missing cmd paramter", "code"=>400, "server"=>"logstream-api-61"}
Sent upon initial connection to a server.
Parameters:
Example:
<- {"cmd":"connected","server":"logstream-api-61"}
Sent to indicate an available log source.
Parameters:
Example:
<- {"type":"varnish-request","cmd":"available","server":"bal-4","display_type":"Varnish request"}
Requests a list of all available log sources from one specified server or all servers. Parameters:
One or all servers will send available messages for each available log source.
Example:
-> {"server":"srv-6","cmd":"list-available"}
<- {"display_type":"Apache request","server":"srv-6","cmd":"available","type":"apache-request"}
<- {"display_type":"Apache error","server":"srv-6","cmd":"available","type":"apache-error"}
Starts streaming a specific source previously offered via an "available" command.
Parameters:
Sends a success or error reply.
Example:
-> {"cmd":"enable","type":"varnish-request","server":"bal-4"}
Stops streaming from an enabled source.
Parameters:
Sends a success or error reply.
Example:
-> {"cmd":"disable","type":"varnish-request","server":"bal-4"}
Requests a list of all enabled log sources from one specified server or all servers.
Parameters:
One or all servers will send a enabled reply.
Parameters:
Example:
-> {"server":"srv-6","cmd":"list-enabled"}
<-> {"server":"srv-6","cmd":"enabled","enabled":["drupal-watchdog","apache-request","php-error"]}
Sent when a new, enabled line of log data is available. Parameters:
Line messages may also contain other data depending on the log type:
Example:
<- {"text":"107.0.255.129 - - [07/Jul/2014:20:28:53 +0000] \"GET / HTTP/1.0\" 200 2454 \"-\" \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36\" vhost=mysitedev.devcloud.acquia-sites.com host=mysitedev.devcloud.acquia-sites.com hosting_site=mysitedev pid=6863 request_time=80001 request_id=\"v-4fe9953a-0615-11e4-9fd8-1231392c7b9c\"","server":"srv-6","cmd":"line","http_status":200,"log_type":"apache-request","disp_time":"2014-07-07 20:28:53"}
FAQs
Unknown package
We found that logstream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.