Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

The practical pipeline is rsyslog on each Linux host → Telegraf’s syslog input on a central VPS → InfluxDB → Grafana. Rsyslog forwards selected messages, Telegraf parses them, InfluxDB stores timestamped records, and Grafana displays those records as searchable log rows and dashboards. This design is a good fit for a modest log workload when you already operate Telegraf and InfluxDB for metrics.

What the centralized logging design looks like

Each source server keeps its normal local logging and also forwards the events you choose. A central VPS accepts the stream on a dedicated syslog listener. Telegraf converts incoming syslog messages into structured fields and writes them to InfluxDB. Grafana then queries the measurement and formats rows as logs.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Linux host A ─┐
Linux host B ─┼─ rsyslog ──> Telegraf syslog input ──> InfluxDB ──> Grafana
Linux host C ─┘

Grafana’s published syslog example uses classic syslog reception on UDP port 514 at the source side, then forwards RFC5424-formatted messages to Telegraf over TCP port 6514. Telegraf’s syslog input can instead listen directly on UDP, TCP, TLS, or a Unix-domain socket. When no port is specified, the plugin documentation identifies TCP port 6514 as its default.

Centralization gives you one place to investigate a failed deployment, compare events from several machines, and build views such as authentication failures by host or service restarts over time. It does not remove the need for local logs: keep local rotation and enough local history to diagnose a network outage between a source host and the VPS.

Decide the scope before installing anything

Choose the source hosts and facilities

Start with an inventory of machines that will send logs and the facilities or applications that matter. Common candidates include authentication events, the kernel, cron or systemd jobs, web services, databases, and security tools. Forwarding every facility at every severity can create noise and consume disk quickly, while forwarding too little can leave gaps during an incident.

  • List each source hostname and its private or public address.
  • Identify which facilities and severities are useful for operations or security.
  • Record the expected time zone and clock-synchronization policy for every host.
  • Decide how long centralized records must remain searchable.
  • Keep a copy of the exact rsyslog and Telegraf configuration in your change-management system.

Separate management traffic from ingestion

Grafana and InfluxDB management interfaces should remain private or require strong access control. Expose only the syslog listener needed by source hosts, and restrict that listener by source IP at the VPS firewall. If sources cross an untrusted network, use TLS rather than sending log contents in clear text.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Allow for workload-specific sizing

No universal CPU, memory, disk, or retention number applies to every VPS. The required capacity depends on event rate, message size, query concurrency, retention, and whether the VPS also runs other services. Begin with a conservative retention period, measure actual disk growth, and adjust after observing your own traffic.

Prepare the central Linux VPS

Install the three services

Install InfluxDB, Telegraf, and Grafana using the packages and repository instructions for the VPS distribution and version. Keep the operating system current, enable automatic security updates where appropriate, and verify that each service is supported on the chosen distribution.

InfluxDB deployments may use an organization and bucket model or a database-oriented model, depending on the InfluxDB edition and API you select. Decide this before writing the Telegraf output and Grafana data-source settings so that the names and credentials match.

Define the network boundary

Create a firewall rule that permits the selected syslog transport only from known source addresses. Do not expose InfluxDB’s write or query endpoint to the public internet unless it is protected by an appropriate network boundary and authentication. Treat Grafana’s web interface as an administrative service: bind it to a private interface or place it behind an authenticated reverse proxy and allow only intended users.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check time and name resolution

Centralized timelines are useful only when clocks are reliable. Confirm that the VPS and every source host synchronize time and that hostnames used in dashboards resolve consistently. If a machine’s clock jumps, its events can appear out of order even though ingestion is functioning correctly.

Configure Telegraf as the syslog collector

Provide both an input and an output

Telegraf requires a configuration that enables at least one input plugin to collect data and one output plugin to write data. Enable the inputs.syslog plugin for the listener and an InfluxDB output plugin for storage. A collector with only the listener enabled can accept traffic but has nowhere to persist it; an output without an input has nothing to write.

Select the transport and port

For a private, trusted network you can use TCP or UDP. TCP provides a connection-oriented stream and is generally easier to reason about when messages must arrive intact. UDP is simple and has low overhead, but it does not provide delivery guarantees. For traffic over an untrusted network, configure the syslog input for TLS and validate certificates according to your certificate authority policy.

[[inputs.syslog]]
  server = "tcp://:6514"
  # Use the TLS listener and certificate settings required by your deployment when needed.

[[outputs.influxdb_v2]]
  urls = ["http://127.0.0.1:8086"]
  organization = "YOUR_ORGANIZATION"
  bucket = "YOUR_BUCKET"
  token = "$INFLUX_TOKEN"

The snippet is a pattern, not a drop-in distribution package. Use the output plugin that matches your InfluxDB edition, replace the endpoint and names, and validate the configuration with the Telegraf command supplied by your package before restarting the service.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep credentials out of the configuration file

Telegraf’s setup guidance recommends environment variables or a secret store instead of embedding credentials in plain text. Give the Telegraf service account only the write permissions it needs. Protect the environment file or secret reference with filesystem permissions, and do not paste tokens into tickets or shell history.

Choose parsing and framing deliberately

Syslog messages can use different framing and formats. Ensure the rsyslog sender and Telegraf listener agree on protocol, framing, and whether the payload is RFC5424. Telegraf documents support for Unix sockets, UDP, TCP, and TLS, including configurations with or without octet-counting framing. If messages arrive as one long stream, are split unexpectedly, or contain malformed timestamps, check this compatibility first.

Forward logs from each Linux source with rsyslog

Install or enable rsyslog

Many Linux distributions already include rsyslog, but the active service and configuration paths vary. Confirm that it is running, identify the file where your distribution loads forwarding rules, and make a backup before editing. Validate syntax before restarting so a new rule does not stop local logging.

Forward only the messages you need

Use rsyslog selectors or conditional rules to choose facilities and severities. A forwarding rule can target the VPS by address and port. The following illustrates the shape of a TCP forward using an RFC5424 template; adapt the syntax to the rsyslog version installed on the source host.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
template(name="RemoteRFC5424" type="string"
         string="<%%PRI%>1 %%TIMESTAMP:::date-rfc3339%% %%HOSTNAME%% %%APP-NAME%% %%PROCID%% %%MSGID%% - %%msg%n")
action(type="omfwd" target="LOG_VPS_ADDRESS" port="6514"
       protocol="tcp" template="RemoteRFC5424")

For a classic UDP arrangement, rsyslog can receive messages on UDP port 514 and forward them in RFC5424 format to the Telegraf listener. Do not open a public UDP listener without a firewall rule limiting the permitted senders; an unrestricted listener can be abused for noise or spoofed events.

Use TLS when the path is not trusted

Configure rsyslog’s TLS transport and Telegraf’s TLS syslog listener as a pair. Install the required certificate and key files with permissions that prevent ordinary users from reading private keys. Decide whether the sender validates the collector certificate, whether the collector validates client certificates, and how certificate rotation will be performed. Test renewal before the current certificate expires.

Reload safely and verify locally

  1. Run the rsyslog configuration check provided by your distribution.
  2. Reload or restart rsyslog only after the check succeeds.
  3. Generate a test event on the source host using the local logger utility or a harmless service event.
  4. Confirm that the source host reports no forwarding errors and still writes its local log.
  5. Repeat the test after a VPS firewall reload or a Telegraf restart to verify recovery behavior.

Model log records so Grafana queries remain useful

Preserve the fields readers actually investigate

Retain the event timestamp and message text, plus the host, application name, facility, severity, and message ID when those values are present. These fields let you answer “when did it happen?”, “which machine?”, “which service?”, and “how serious was it?” without parsing the raw message in every dashboard query.

Field Purpose Typical treatment
Timestamp Places the event on a timeline Store as the record time used by Grafana queries
Message Contains the human-readable event Keep as a field suitable for display in a Logs panel
Host Identifies the source machine Use as a stable filter dimension
Application name Identifies the emitting service Keep when supplied by the sender
Facility Groups standard syslog classes Use for operational and security filters
Severity Indicates relative urgency Use as a filter or dashboard grouping
Message ID Distinguishes structured event types Preserve when the sender supplies it

Keep stable dimensions as tags

Host, severity, facility, and application are generally stable enough to filter on. Avoid turning the full message text, request ID, username, or another value that changes on nearly every event into a tag. High-cardinality tags increase index and memory pressure and can make queries harder to operate. Store such values as fields or in the message body unless you have a measured reason to index them.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Account for incomplete syslog metadata

Older applications may omit an application name or message ID, and some messages do not contain structured data. Keep empty or missing values distinguishable from a literal value supplied by the sender. Do not discard the original message merely because optional fields are absent.

Write records to InfluxDB and set retention

Match the Telegraf output to your InfluxDB edition

Enter the correct InfluxDB URL, organization and bucket or database, and a credential with write access. If InfluxDB runs on the same VPS, use a local address for the write path where practical. If it is remote, protect the connection and account for network latency and failure.

Choose a measurement and retention policy

Use a clearly named measurement for syslog records so Grafana queries do not mix logs with unrelated metrics. Set retention according to the value of historical searches and the disk available on the VPS. A short hot-retention period can keep dashboards responsive; archive or export older data only if your operational or compliance requirements demand it.

Retention is a workload decision, not a fixed number supplied by the software. Watch disk utilization, write errors, compaction activity, and query latency. If disk usage grows faster than expected, first reduce unnecessary facilities or shorten retention rather than allowing the filesystem to fill.

Use a known time range during initial tests

When testing ingestion, query a narrow range around the exact time of a generated event. A broad query can look empty because of a time-zone mismatch or because the event fell outside the dashboard’s default range. Confirm the stored timestamp and host field before troubleshooting the network.

Connect Grafana to InfluxDB

Add the data source

In Grafana, open the administration area, choose Data sources, select InfluxDB, and enter the endpoint and authentication details that match the InfluxDB deployment. Select the query language supported by your edition and verify the connection. Keep the data source unavailable to users who do not need to query logs, and use read-only credentials for dashboard viewers.

Build a Logs view in Explore

Open Explore, choose the InfluxDB data source, and query the measurement that contains the syslog records. Grafana’s InfluxDB editor expects query results to include a timestamp and a message column for log rendering. Include level or severity and host as additional context, then choose the Logs format when the result is displayed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Set the time picker to the period in which you generated a test event.
  2. Select the syslog measurement and return the timestamp column.
  3. Return the message column used for the row text.
  4. Add host, severity, facility, or application as contextual columns.
  5. Switch the visualization or result format to Logs.
  6. Filter by host or severity and confirm that the expected rows remain visible.

Turn the query into a dashboard panel

Save the working query as a Logs panel only after it behaves correctly in Explore. Add dashboard variables for stable dimensions such as host, application, or severity. Keep the default time range modest enough for routine use, and create separate panels for counts or rates when a table of raw messages is not the best way to spot a trend.

Test the entire path from source to screen

Test one hop at a time so a failure has a clear boundary.

  1. Source generation: create a distinctive, harmless test message on one Linux host.
  2. Rsyslog selection: verify that the message matches the forwarding rule and remains in the local log.
  3. Network reachability: confirm that the source can reach the VPS listener address and port through every firewall in between.
  4. Telegraf reception: inspect the Telegraf service status and logs for parser, bind, TLS, or permission errors.
  5. InfluxDB write: query the target bucket or database directly, using the event’s approximate timestamp and host.
  6. Grafana rendering: run the query in Explore and check that timestamp and message columns are present.
  7. Restart recovery: restart Telegraf during a maintenance window, then send another test event and verify that ingestion resumes.

Troubleshoot the failures you are most likely to see

No events arrive at Telegraf

  • Confirm the source rule is loaded and has no earlier rule that discards the event.
  • Check the VPS firewall and any cloud security group for the selected port.
  • Make sure the sender’s protocol and port match the Telegraf server setting.
  • Verify that Telegraf is listening on the expected interface rather than only on loopback.
  • For TLS, check certificate trust, key permissions, hostname validation, and clock accuracy.

Telegraf receives data but InfluxDB stays empty

  • Inspect Telegraf output errors for an invalid URL, organization, bucket, database, or token.
  • Check that the token has write permission to the selected destination.
  • Verify that the output plugin matches the InfluxDB edition and query model.
  • Look for rejected records caused by malformed timestamps or fields.
  • Confirm that disk space and InfluxDB service health are adequate.

InfluxDB contains records but Grafana shows nothing

  • Expand the dashboard time range around the event timestamp.
  • Check that Grafana uses the intended organization, bucket or database, and measurement.
  • Run the query in Explore before editing the dashboard panel.
  • Ensure the result contains a timestamp and a message column and that the query language matches the data source.
  • Remove host or severity filters temporarily to detect a mismatched tag value.

Rows appear duplicated, split, or out of order

Check whether more than one rsyslog rule forwards the same event, whether UDP fragmentation or loss is involved, and whether sender and receiver disagree about RFC5424 framing or octet counting. Compare the original local message with the stored message and inspect timestamps for clock drift.

The VPS fills its disk

Measure which measurement and retention policy are growing, then reduce unnecessary source traffic, shorten retention, or allocate appropriate storage. Do not delete random files from InfluxDB’s data directory while the service is running. Make retention changes through the database’s supported controls and keep backups of any data that must be preserved.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operate the stack after it works

Run Telegraf under systemd

Use the distribution’s systemd unit so Telegraf starts on boot, restarts after a failure according to your policy, and writes service logs that can be monitored. Keep the configuration in a protected path, restrict ownership to root and the Telegraf service account as appropriate, and validate changes before every reload.

Monitor ingestion health

Watch Telegraf input and output errors, InfluxDB write failures, listener connection counts, disk use, and Grafana query latency. A dashboard that shows only successful queries can hide a silent ingestion outage; include an operational signal that indicates whether new events have arrived recently.

Plan upgrades and certificates

Upgrade Grafana, InfluxDB, Telegraf, and the operating system in a maintenance process that includes configuration backups and a rollback plan. Test plugin or query-language changes before applying them to the production dashboard. For TLS, document certificate locations, renewal ownership, and the exact reload procedure.

Protect sensitive log content

Logs can contain usernames, addresses, tokens, command lines, or application data. Limit who can query them, avoid exporting raw rows to public dashboards, and redact sensitive values at the source when possible. Use separate read and write credentials and rotate them when staff or systems change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

InfluxDB or Loki for centralized logs?

InfluxDB is reasonable when the VPS already uses Telegraf and InfluxDB for metrics, the log volume is modest, and one operational stack is more valuable than a dedicated log store. Loki is a stronger candidate when log-specific storage and label-oriented querying are the priority. Grafana’s current guidance describes its hosted log service as Loki-powered, and the Loki project documents an architecture in which an agent such as Alloy gathers logs, Loki stores and queries them, and Grafana visualizes the results.

Loki does not index the full contents of every log line like a traditional full-text engine. It indexes labels and retrieves log content around those labels. That can make label design and query expectations different from an InfluxDB schema.

Decision axis InfluxDB with Telegraf Loki-oriented stack
Existing metrics integration Strong when Telegraf and InfluxDB already run on the VPS Usually adds a log-specific storage and collection path
Collection choices Telegraf syslog supports Unix sockets, UDP, TCP, and TLS Uses a Loki-compatible collector and push path
Data model Timestamped records with fields and selected dimensions Log streams organized around labels; full text is not indexed like a conventional search engine
Best fit Modest volume, shared metrics and logs, familiar InfluxDB operations Log-focused retention, label queries, and a dedicated logging workflow
Main caution High-cardinality dimensions and long retention can increase storage and query cost Poorly chosen labels can create too many streams, while expecting unrestricted full-text indexing leads to disappointing queries

Use a simple selection test

  • Choose InfluxDB if reusing your existing Telegraf and InfluxDB stack reduces operational overhead and your event volume is manageable.
  • Choose Loki if the primary requirement is a purpose-built log system with label-based streams and log-oriented retention.
  • Choose neither solely because a dashboard example exists; estimate volume, retention, query patterns, and the skills available to operate the stack.
  • Whichever system you choose, test a representative event set and the queries investigators will actually run before committing to long retention.

A production-readiness checklist

  • Every source host has a documented rsyslog forwarding rule and still retains local logs.
  • The central firewall permits only known senders and the selected syslog port.
  • TCP or TLS is used when delivery or confidentiality matters across an untrusted path.
  • Telegraf has one working syslog input and one working InfluxDB output.
  • Credentials come from environment variables or a secret store, not committed plain text.
  • Host, application, facility, severity, message ID, timestamp, and message are preserved where available.
  • Unique message content is not used as an unbounded tag.
  • InfluxDB retention is tied to measured disk capacity and business requirements.
  • Grafana queries return a timestamp and message column and render correctly as Logs.
  • Ingestion errors, disk growth, and certificate expiry are monitored.
  • A test event is generated after upgrades, firewall changes, and certificate renewals.

What this architecture can and cannot promise

The rsyslog-to-Telegraf path centralizes events efficiently, but it is not automatically lossless. UDP can lose packets, a source can queue or discard messages when its forwarding path is unavailable, and a full destination disk can stop writes. TCP and TLS improve transport behavior and confidentiality, yet they do not replace queue monitoring, retention planning, backups, or local logs.

Grafana provides the investigation surface, not the storage guarantee. A successful data-source connection proves only that Grafana can reach InfluxDB; it does not prove that every source host is forwarding. Build health checks around freshness of incoming events and review the collector and database logs when the dashboard is unexpectedly quiet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Final implementation sequence

  1. Install and secure InfluxDB, Telegraf, and Grafana on the central VPS.
  2. Open only the chosen syslog listener to approved source addresses.
  3. Configure Telegraf’s syslog input and matching InfluxDB output, with secrets supplied securely.
  4. Configure one source host to forward selected facilities in the agreed format.
  5. Generate a test event and verify reception, storage, and Grafana rendering in that order.
  6. Add remaining hosts gradually, checking volume, tags, disk growth, and query performance.
  7. Set retention, monitoring, TLS renewal, backups, and an upgrade procedure before declaring the service operational.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.