An HTTP server-side events plugin for [logagent](https://github.com/sematext/logagent-js). Can be used for e.g. writing a custom web log live tail UI.
npm install logagent-output-http-sseAn HTTP server-side events plugin for logagent. Can be used for e.g. writing a custom web log live tail UI.
On the machine where you're running logagent:
```
npm install -g logagent-output-http-sse
In logagent's config.yml output section, add:
``
output:
http-sse:
module: logagent-output-http-sse
port: 80
Adjust port as needed. If omitted, it will listen on 3000.
Assuming logagent is running on log.example.com, the following will stream all log events to the browser console:
``
To request events from certain sources only, use a "source" query parameter with an extglob pattern value.
For example, to only request events from sources beginning with "myapp_":
```
const eventSource = new EventSource('http://log.example.com/events?source=myapp_*')
There is no authorization or encryption, please use a reverse proxy to provide those if running on an untrusted network.