Skip to content

Realtime Telemetry Log Streaming

Send your proxy access logs to Graylog or SigNoz as they happen. Watch many XProxy servers in one place, build dashboards and get alerts on errors.

You need: a Graylog or SigNoz server that your XProxy box can reach. The guide shows how to install one.

In short

Live, line by line

XProxy reads its proxy log. Every new line goes to your log server as soon as it is written.

Two tools

Graylog gets GELF over UDP. SigNoz gets OTLP over HTTP. You use one of them.

Search and alert

Filter by device, port, website or error code. Build dashboards and alerts in your tool.

Set it up

Which tool do you use?

Step 1 of 6

Install Graylog

Graylog is the server that collects your logs. Already have one? Skip this step.

On an Ubuntu server (18.04, 20.04 or 22.04), run:

Terminal
curl x-proxy.io/graylog | bash

The script installs Graylog with Docker and asks for an admin password (press Enter to use admin). When it ends, open http://<server-ip>:9000 and log in as admin.

The script opens ports 9000 (web) and 12201 (logs). On a cloud server, also allow them in the provider's firewall for your XProxy box.

What XProxy sends

  • It reads the proxy log files (xproxy.log) in the Log Path folder. It sends only new lines, the moment they are written.
  • Every line becomes one message: your Service Name, a |, then the original line.
  • The message is marked as an error when error_code is not 00000.
  • The parts of the line also arrive as separate fields, so you can search and group by them:
FieldTypeWhat it is
log_dateTextDate of the line, day/month
log_timeTextTime of the line, HH:MM:SS
proxy_serviceTextService tag of the line, for example MAIN
modem_positionTextPosition (slot) of the device that served the request
proxy_protocolTextProtocol label in the line. It can be empty
proxy_portNumberPort of your XProxy that the client used
proxy_userTextLogin the client used. Empty when it logged in by IP
client_ipTextIP of the client that used the proxy
client_portNumberPort of that client
destination_hostTextWebsite or host the client asked for
destination_portNumberPort of that host
actionTextCONNECT for an HTTPS tunnel, or the HTTP method (GET, POST, ...) of a plain HTTP request
error_codeText00000 means success. Any other code is an error
received_bytesNumberBytes from the website to the client
sent_bytesNumberBytes from the client to the website
log_fileTextName of the log file the line came from
service_nameTextThe Service Name from your form

Handy searches

You wantGraylogSigNoz
One service or regionservice_name:xproxy-us-eastservice.name = "xproxy-us-east"
Only errorsNOT error_code:00000error_code != "00000"
Only HTTPS tunnelsaction:CONNECTaction = "CONNECT"
One devicemodem_position:3modem_position = "3"
One proxy portproxy_port:4001proxy_port = 4001

modem_position is text, so SigNoz wants quotes around the number. Query syntax can differ a little between versions of your tool.

What you can do with it

You want toHow
Count the different clientsCount unique client_ip.
Track the error rateCount lines where error_code is not 00000.
Find top websites and bandwidthGroup by destination_host and add up received_bytes and sent_bytes.
Watch one dongle or portFilter by modem_position or proxy_port.
Get an alertAlert on a sudden rise of errors, or when a server sends no logs for a while.

Many servers

  • Give every server its own Host Identifier (Graylog) and every region or group its own Service Name.
  • Keep the names the same style. For example start with prod- or stg- to tell setups apart.
  • Decide how long to keep logs in your tool. Graylog and SigNoz have their own retention settings.

Error codes

error_code has five digits. The leading zeros are on purpose: they keep sorting and filtering simple.

CodeMeaning
00000Success. The connection closed normally
00001–00009Login or access rule errors
00010Traffic limit reached
00011–00019Connection errors (socket, bind, connect)
00020–00029Internal errors, such as memory
00030–00039HTTP CONNECT redirection errors
00050–00069SOCKS5 redirection errors
00090–00099Timeouts and network problems
00100Host not found
00200–00299UDP port mapping errors
00300–00399TCP port mapping errors
00400–00499SOCKS proxy errors
00500–00599HTTP proxy errors

Something not working?

You seeWhat to do
No logs at allCheck that Enable Telemetry is on and you clicked Save. Send traffic through a proxy port: only new lines are sent. Check that Proxy Access Logs are on in Proxy Settings, and that Log Path is the folder that holds xproxy.log.
Save says an endpoint or key is requiredSigNoz needs the endpoint and the ingestion key. Graylog needs the server. Both need a Service Name and a Log Path.
Graylog shows nothingCheck that the GELF UDP input is running on port 12201, and that your firewall allows UDP 12201 from your XProxy box.
SigNoz test failsThe endpoint must have port 4318 and be reachable from the box. Check the ingestion key.

Questions

Why is proxy_user empty?

The client logged in by IP, so there is no username.

What is the difference between CONNECT and GET or POST?

CONNECT opens a tunnel, used for HTTPS. A plain HTTP request shows its method instead, such as GET or POST.

How do I alert on errors?

Make a rule on error_code not equal to 00000 over a time window. Group by service_name or modem_position to see where it comes from.

Use with AI

Still stuck?A technician can look at your device with a one-time PIN, or chat with us on Telegram.