When Zabbix log file monitoring is the right tool
If your hosts are already monitored by Zabbix and you need alerts on a handful of specific log lines, such as a fatal error in an application log or a failed authentication pattern, log[] and logrt[] items can do that job. They suit a bounded set of files on known hosts, where you can name the files and describe the lines you care about. The agent reads the file, matches each new line against a regular expression on the host itself, and sends matching lines to the server as item values that can trigger triggers and notifications.
The key distinction is that this is alerting on lines, not log search or analytics. log[] watches one file by path and logrt[] watches a set of rotating files matched by a pattern, but neither indexes history, supports ad hoc queries across hosts, or gives you dashboards over log volume. If your team needs to search, correlate or retain logs at scale, or to investigate events across many sources, a log platform is a better fit, and Zabbix log items can complement it by covering the few conditions that must page someone.
Before you commit, confirm three things in your own environment: how many files and hosts the matching will cover, how many matching lines per second you expect at peak, and whose retention and access rules apply to the log content that Zabbix will forward to the server. The Zabbix log file monitoring documentation sets the per-check limits you will need to design around, and if the answers point to broad search or long retention, plan for a log platform instead.
Choosing between log[] and logrt[] for each file
Use log[] when an application writes to one file path that stays the same for the life of the process. The key names that file, and the agent reads new lines appended to it and keeps its place between checks. Nothing in the key tells the agent to look for a successor file, so log[] will not follow a file that is moved away or replaced.
- Stable path: the file name in the key must match the path the application keeps writing to, including after restarts.
- Position tracking: the agent resumes from its last read position, so confirm how that position is kept in your agent version before you rely on it after an agent restart.
- Line filter: the regular expression parameter decides which lines become items, which reduces the volume that counts against the per-check limits.
- Per-check limits: the number of lines analyzed and sent is capped on each check, so a noisy file needs a tighter filter or a higher limit set on purpose.
Check that the application never renames, truncates or replaces this file, because log[] is not the right key for a file whose identity changes.
Use logrt[] when the active file is renamed by a rotation tool and a new file is created under the original name. The first parameter is a regular expression that matches the active file and its rotated copies by full path, so the agent can move from the old file to the new one when rotation happens. This is the case the item was designed for, but the details of the rotation method still matter.
- Pattern covers the whole path: the expression matches the directory and the file name, so rotated names such as a numbered suffix must still match the pattern.
- Rename-based rotation: confirm in the Zabbix documentation for your agent version how the agent tracks a renamed file compared with one that is copied and truncated.
- Copies cause duplicates: copying a file back under its original name or changing its modified time can make the agent re-read it and send duplicate alerts.
- Archives in the pattern: rotated archives that match the pattern may be read, so decide whether compressed or old copies should match at all, and test that choice.
- Forced rotation test: rotate the file on a staging host and count the alerts that arrive before and after the rotation.
Ask your logrotate or application owner to confirm the exact rotation method, including any copy or truncate step, before you choose the pattern.
Use logrt[] when the application writes a new file each day with a date in the name. The regular expression describes the family of names rather than one path, so the key stays fixed while the file names change. The pattern must match the date format the application actually uses, and every day's file needs to match it.
- Date format: write the pattern against the exact date string in the file name, and check it against several upcoming names before the first rollover.
- Timezone at rollover: if the host clock and the application use different timezones, the day boundary can fall at a different time than expected, so confirm which clock names the file.
- Midnight overlap: lines written around the rollover may land in either day's file, so check that alerts for that window are not missed or counted twice.
- Older day files: earlier daily files still match the pattern, so decide whether they should be read at all and limit the pattern if not.
- Rollover spikes: a new file that starts being read at rollover can push a burst of lines into the per-check limits, so review the limits for that source.
Confirm the regular expression syntax for logrt[] against the Zabbix item documentation for your agent version before you deploy it.
Make the choice per file, not per host, because one server often writes several log sources with different behavior. For each path, record whether it is a fixed file, a rotated set or a daily name, then test the chosen key against a real rotation before any alert depends on it. Most failures appear as quiet gaps after rotation or as bursts of repeated alerts after a file is copied.
- Inventory: list every log source with its writer, rotation tool and rotation schedule.
- Rotation test: force a rotation on a non-production host and watch the item values across the change.
- Gap check: after rotation, confirm that new lines keep arriving within the expected interval.
- Duplicate check: look for repeated alerts after any file copy, restore or timestamp change.
- Version check: item parameters and behavior can differ between agent versions, so read the documentation that matches the agent you run.
Record the chosen key, the test result and the agent version for each file, so that a later change to rotation is reviewed against the same record.
Configuration options and when each fits
This table compares the parameters that shape a log or logrt item, from the regular expression and output settings to the per-check line limits and the 256 kB match ceiling. Read each row as a decision: what the setting controls, when it fits, and what it costs in agent load or alert volume. The main takeaway is that raising limits is a trade-off, so start with defaults and raise only what your log volume proves you need.
| Option | What it controls | When it fits | Trade-off |
|---|---|---|---|
| Regular expression (pattern) | Which lines in the file count as matches for the item | Alerting on a narrow set of failure strings such as ERROR or OutOfMemory | A broad pattern matches more lines, which raises alert volume and load |
| Output parameter | Which part of a matched line or capture group is sent as the value | Extracting a field, such as an error code, for triggers or dependent items | Complex capture groups are harder to test and can silently stop matching after a format change |
| maxlines | Upper bound on how many matched lines the agent sends per check | Bursty logs where you need more matched lines per interval than the default allows | Raising it toward 10,000 analyzed and 1,000 sent increases agent CPU, network use and alert volume |
| MaxLinesPerSecond (agent) | Agent-wide rate that sets the default number of new lines analyzed per check | Hosts with steady, moderate log growth where defaults suffice | Setting it higher applies to every log item on the host, so load grows across all checks |
| Default analysis limit | At most MaxLinesPerSecond x 10 new lines analyzed per check by default | Low-volume application and system logs at a 1 second interval | Lines beyond the limit wait for later checks, so alerts can arrive late during spikes |
| 256 kB match limit | Only the first 256 kB of a log record is matched against the regex | Single-line events and standard application log records | Very large records, such as stack dumps or JSON blobs, may not match on text located after the first 256 kB |
| Rotation and file identity (logrt) | How the agent follows rotated files that match a path pattern | Logs that rotate by renaming or creating new files with timestamps | Copying a file back under its original name or changing its modified time can trigger duplicate alerts |
Setting up log items and verifying them
This sequence takes a log file from permissions and item definition through a controlled test line and a rotation test, so the team knows the agent reads the right file, matches the right lines and stays within its throughput limits before any alert reaches an on-call engineer.
Confirm agent access to the log file
On the monitored host, the administrator checks that the Zabbix agent service account can traverse every directory on the path and read the target file, including any rotated siblings that match the pattern. Run the check as the agent user, not as root, because a permission that works for an administrator often fails for the agent. Done means the agent user can read the file and list its directory without errors. Confirm the agent's own log shows no access errors when it starts.
Define the log or logrt item with a matching regex
The Zabbix administrator creates a log[] item for a single fixed file or a logrt[] item when the file rotates, using a file path regex that matches only the intended file names. Add a content regex that matches the exact lines to alert on, and test that expression against sample lines outside Zabbix before saving. Keep the pattern narrow, since only the first 256 kB of each record is matched against the expression. Done means the item saves with a valid key and the regex matches the sample lines you expect.
Set the item type and update interval
Choose the value type that fits the output: Log for the full matched line, or a numeric value type with an extraction expression when you need a count or a number. Set the update interval so the agent polls at a rate that suits the log volume, and review the throughput limit for the check. The default analyzed-line limit is MaxLinesPerSecond multiplied by 10 per check, and the maxlines parameter can raise it to 10,000 analyzed and 1,000 sent lines. Confirm the chosen values in the item configuration and record them with the change.
Enable the trigger and its recovery logic
Create a trigger on the log item that fires on the matched value, and decide whether repeated matches should open one problem or many. Set a recovery expression or a time-based recovery so the problem closes when the condition clears. Consider what happens if the same line is matched again after a file copy, since duplicate alerts are a known effect of copying a file back under its original name or changing its modified time. Done means the trigger shows the expected state in the latest data view after a test line.
Test with a controlled test line
On a non-production host with the same agent version and configuration, append a unique marker line to the log file, such as a timestamped string that nothing else writes. Confirm in latest data that the item receives the marker as a value, and that the trigger changes state as designed. Then remove the marker from your test expectations and confirm no second copy arrives. Done means one marker produces one matched value and one problem event, with the expected timestamp.
Run a rotation test on the non-production host
Rotate the test file the way your logrotate policy does, then write new marker lines and confirm the agent continues from the new file. Check whether the agent re-reads old content, because copying a file back under its original name or changing its modified time can cause re-reading and duplicate alerts. If duplicates appear, adjust the file pattern, the rotation method or the trigger design before production. Done means old lines are not resent and new lines arrive once each.
Verify throughput and agent health before production
Generate a burst of matching lines at the volume you expect at peak, then check the item history for dropped or delayed values and review the agent log for messages about line limits. Confirm the number of analyzed and sent lines stays within the limits you set, and that the server queue does not grow. Repeat the check after any change to the regex, the interval or maxlines. Done means the burst arrives within the configured limits with no unexplained gaps, and the results are recorded for the change record.
How rotation and file copies cause duplicate alerts
The main duplicate-alert risk in Zabbix log file monitoring comes from how the agent tracks files. According to the Zabbix log file monitoring documentation, copying a file back under its original name or changing its modified time can make the agent re-read that file and send the matching lines again. The result is repeated problems for the same log lines, often in a burst right after a backup or restore job runs. Treat file names and modified times as part of the alerting design, not as incidental metadata.
Handle this in three places. First, keep rotated copies under new names, so the file the logrt[] item watches under its original pattern is never replaced by an older copy. Second, review backup and sync jobs that run against the log directory, and make sure they preserve or ignore timestamps in a way that does not make old content look new. Tools that set modified times to the copy time or restore archives with original timestamps can both trigger re-reading, so check the flags your backup job uses. Third, confirm the rotation settings against your logrotate or application configuration, including whether the application uses copytruncate, create or its own rotation, because each one changes what the agent sees.
Verify the behavior before you rely on the alerts. Run a controlled rotation test on a non-production host: generate a known matching line, rotate the file with the same method production uses, run a backup or copy step if one exists, then count the problems Zabbix raises for that line. Repeat the test after any change to logrotate, the application or the backup tool. An illustrative pass condition is one problem per real event. If a single line produces several problems, adjust the naming or timestamp handling before you move the item to production.
Throughput limits and the 256 kB match ceiling
Zabbix log items are bounded per check, so a noisy file can be only partly analyzed and a long record can be only partly matched. The cards below cover the default caps, the maxlines increase, the match ceiling and the load and alert effects to plan for before you write the first regular expression.
Default analysis cap per check
By default, an agent analyzes at most MaxLinesPerSecond x 10 new lines per check. At a 1 second interval with the default MaxLinesPerSecond of 20, that is 200 lines analyzed and 20 sent. Lines beyond the cap are not evaluated in that check, so a burst of errors can be missed or delayed. Check the value of MaxLinesPerSecond in your agent configuration and compare it with the peak line rate of the busiest log before you rely on the item for alerting.
Zabbix log item docsRaising the cap with maxlines
The maxlines parameter on a log or logrt item can raise the ceiling to 10,000 lines analyzed and 1,000 sent per check. Raising it is a per-item decision, so apply it only to the logs that need it. Test the item against a realistic burst from a staging host, then confirm that the agent keeps up with the interval you chose and that the Zabbix server can store the extra values.
First 256 kB of each record
Only the first 256 kB of a log record is matched against the regular expression. A record longer than that, such as a stack trace or a serialized JSON payload, can carry the error keyword beyond the cutoff and never match. Ask developers where the key fields appear in each message, and move the match target earlier in the line, for example by logging a severity field near the start, before you assume the pattern covers the whole event.
Noisy logs and alert floods
A log that produces many matching lines drives agent CPU and disk reads on the monitored host, and every sent value adds load on the server and the database. Without a tight regular expression and a trigger that fires on a rate or a count, one event can become hundreds of problems. Before go-live, measure the match rate on production-like traffic, tune the pattern to the lines you act on, and set trigger conditions that group repeated events.
Agent version and host capacity
Confirm the agent version and the log item options your release supports, since behavior and parameters differ between agent and agent 2 and between Zabbix releases. Also confirm that the host has spare CPU, memory and disk I/O for the reads your limits allow, especially on hosts with several logs matched by logrt[]. Ask your Zabbix support or implementation partner to validate these numbers against your agent build, and record the results with the item configuration.
How the agent reads log files and sends matches to the server
The flow starts with the application writing lines to a log file on the monitored host. When the file is rotated and renamed, the agent follows the logrt[] item to the new file, while log[] stays on the named path. The agent applies the regular expression and per-check limits, then sends only the matches over an active check to the server or proxy, where triggers raise problems and notifications go out. The dashed trust boundary marks the monitored host, the only place the agent reads files.
Log lines move from the application, through rotation, into matched items on the server.
Questions teams ask before setting up Zabbix log monitoring
What does Zabbix log file monitoring cost, and what drives the effort?
The Zabbix agent itself carries no license fee, so the cost is almost entirely the work of designing and testing the checks. Zabbix states its open source software has no license fee, no device limits and no feature gates. The main cost drivers are the number of log files, how complex the regular expressions are, how the files rotate, and how many distinct alert conditions the team wants. Each file and each pattern needs sample lines, a tested expression, a throughput decision and an alert owner. Ask any partner for a quote built from a written list of files, patterns, rotation methods and alert destinations, and ask whether the quote includes a test period on real traffic.
How long does a log monitoring rollout take?
The duration depends on the environment more than on Zabbix itself. Timing is set by how many hosts and files are in scope, whether the hosts already run agents, how quickly your team can provide log samples and approve alert rules, and whether change windows apply to production hosts. Plan for a discovery phase on a small set of representative hosts, then a staged rollout with a review of alert volume after each stage. Confirm the timeline in writing before work starts, and ask which steps depend on your team's availability.
What must our internal team provide before the work starts?
Three inputs decide most of the schedule. First, host access: an account or change process that lets the implementer reach the monitored hosts, read the log paths and restart or reload the agent. Second, log samples: real lines from normal operation and from known failure events, with timestamps, so the expressions can be tested against both. Third, alert owners: named people or on-call rotations who will receive each alert, agree on severity and say what action follows. Without alert owners, checks tend to produce noise nobody acts on, so name them before the first rule is built.
Can our own team set up log file monitoring without a partner?
Yes, a team with Zabbix experience can configure a few log[] or logrt[] items on a small number of hosts. The harder parts are operational: matching regular expressions to real log formats, choosing maxlines and rate limits, testing rotation and copy behavior, and avoiding duplicate alerts after file copies. Only the first 256 kB of a log record is matched against the regular expression, so long records need design. Consider a partner when many hosts or applications are involved, when you need a documented test plan for an audit, or when your own staff have limited time to tune alerts over several weeks.
What breaks most often with log[] and logrt[] items?
The most common problems are throughput limits, rotation handling and duplicates. By default an agent analyzes at most MaxLinesPerSecond x 10 new lines per check, so a busy application can silently fall behind unless the maxlines parameter is raised, up to 10,000 analyzed and 1,000 sent. Copying a file back under its original name or changing its modified time can make the agent re-read it and send duplicate alerts. Expressions that work on a sample file may also fail on rotated names, compressed copies or lines longer than 256 kB. Test each of these cases on a staging host before production rollout.
When is a log platform such as Graylog or Loki a better choice than Zabbix log items?
Zabbix log items suit alerting on specific lines from known files that feed into existing Zabbix problems. A log platform suits broad search, long retention, ad hoc investigation across many sources and dashboards built by people outside operations. Graylog Open is free with no volume limits and community support, while Graylog Enterprise starts at 15,000 US dollars per year and Graylog Security at 18,000 US dollars per year, each with a minimum of 10 GB per day or 100 Graylog Compute Units, according to the Graylog pricing page. Loki has three deployment modes: monolithic (up to about 20 GB of logs per day), simple scalable and microservices, and its retention is disabled by default, so logs are kept until you enable it. Confirm the licensing terms and current figures with each vendor before deciding.
What does a log monitoring engagement include, and what do we keep afterward?
A typical scope covers an inventory of log sources, a design of item keys and triggers, configuration on the agreed hosts, tests against samples and rotation scenarios, a handover of templates and an runbook for alert owners. Engagements are usually fixed-scope, with deliverables and timelines agreed in writing before work starts. After handover, your team keeps the Zabbix configuration, templates and documentation, and can add retainer support for upgrades or tuning. Ask for the exact list of deliverables in the written scope, including who owns the templates and where the test evidence is stored.
Security and operational considerations for log monitoring
Log monitoring reads files that often hold credentials, personal data and internal paths, so the agent's access, what it sends onward and who maintains the rules all need deliberate decisions. The cards below cover the controls to agree with your security and operations teams before the first log item goes live.
Read permissions for the agent user
The Zabbix agent reads log files as its own operating system user, so that account can see anything it is allowed to open. Grant read access only to the specific files or directories each item needs, and confirm that the agent user cannot write to them or read neighboring application data. Check group memberships and default umask settings on rotated files, because new log files created by a rotation job may inherit broader permissions than the originals. Confirm the final model against your access control policy.
Zabbix log item docsKeeping secrets out of alert payloads
A matched log line is sent to the Zabbix server as item data and can then appear in problem descriptions, event views, notifications and exported history. Applications often write tokens, session identifiers, connection strings or personal data into their logs, so a pattern that matches an error line may also expose those values. Review sample matched lines with your data protection owner, and consider whether the item should capture only an error code or event type rather than the full line. Confirm where Zabbix history and notification channels retain this data under your policies.
Reviewing regex patterns over time
Each log[] or logrt[] item carries a regular expression that decides what becomes an alert, and that expression is code that someone must own. Patterns written for one application version can silently stop matching after a log format change, or start matching far more lines than intended after a message is reworded. Record the purpose of each pattern, the owner, and the sample lines it was tested against, and review them whenever the application or its logging library changes. Keep the test samples free of sensitive data.
Monitoring the agent itself
A log item that stops reading produces no error, only silence, so a broken log pipeline can look like a healthy system. Watch the agent's availability through its host item, and check that the log items return data on a schedule that matches the application's normal activity. Use the agent's own log file to catch permission errors and rotation problems that may not reach the Zabbix server. Ask your operations team which alert covers a log item that has gone quiet, and confirm that it is tested after each agent or host change.
Ownership of alert tuning
Every log alert carries a continuing cost in attention, and noisy patterns train on-call staff to ignore notifications. Assign one named team to own each log item, its threshold, its severity and its escalation path, and set a review step after the first weeks of live data. Decide who may change a pattern in production and how changes are recorded for later audit. Ask your security and operations leads to confirm this ownership model in writing before the alert set is widened.
Log item behaviorWhen a log platform is the better tool than Zabbix log items
Use Zabbix log items for a bounded question: is a specific pattern appearing on specific hosts, and should someone be paged when it does? Choose a log platform when the questions change shape. Searching across many hosts and applications, keeping logs for long periods, building dashboards for teams that never use Zabbix, and running investigations that move from an alert to related events all favor a dedicated log tool. Zabbix stores matched lines as item history on each host, so it is not designed as a searchable archive. Before deciding, list the questions your investigators ask most often and how far back they need to look.
Graylog Open is the closest fit for teams that want a search and alerting platform without a per-volume fee. It ingests syslog, GELF and Beats inputs, routes messages through streams and pipelines, and raises alerts through event definitions. Its backend is MongoDB for configuration and Graylog Data Node or self-managed OpenSearch for storage, so you will operate two data stores plus the Graylog nodes. Graylog Open is licensed under SSPL-1.0, which the Graylog project itself describes as not OSI-approved, and that license is different from the GPL v3 used by earlier releases. Have your legal counsel review the license against how you plan to offer the platform internally and to any external parties.
Grafana Loki suits teams that already run Grafana and can store logs in object storage. It is licensed under AGPLv3, and its retention is disabled by default, so you must enable it deliberately or logs accumulate indefinitely. Loki has no built-in authentication, so an authenticating reverse proxy must sit in front of it, and Grafana Alloy is the supported shipper. Confirm with your security team how tenants, access and audit requirements will be met, and confirm the AGPLv3 terms with your counsel. Whichever platform you choose, run a pilot on real log volume to size storage and ingest before committing.
How DeployOpen scopes and delivers Zabbix log monitoring
DeployOpen starts by agreeing in writing which log files, which hosts and which alert conditions the Zabbix setup will cover, then builds and tests the log[] and logrt[] items against real rotation and copy events in your environment. Engagements are fixed-scope, so the deliverables, the handover and the testing evidence are defined before the build begins.
How we scope
- Inventory each log file, its rotation scheme and the hosts that write it before any item is designed.
- Agree in writing which patterns trigger problems and which lines are only collected for later search.
- Set per-check throughput expectations using the MaxLinesPerSecond and maxlines limits, documented in the scope.
- Decide with you whether Zabbix or a log platform such as Graylog or Loki should own each log source.
How we build
- Create log[] and logrt[] items with regular expressions tested against sample lines from your own logs.
- Configure rotation handling so copies, renames and touched files do not trigger duplicate alerts.
- Keep each matched record under the first 256 kB that Zabbix evaluates, and document any longer-line exceptions.
- Wire triggers, tags and templates so log problems follow the same notification path as other Zabbix problems.
How we hand over
- Deliver the item keys, regular expressions, trigger definitions and template exports in a versioned repository.
- Provide a test record showing rotation, copy and high-volume scenarios and the alerts each one produced.
- Document the operating runbook, including how to raise maxlines and what to check after log file copies.
- Walk your operations team through the configuration and confirm who owns changes after handover.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
- Review new log formats and rotation changes from your applications before they reach production alerting.
- Re-test log items after Zabbix version upgrades to confirm parsing and throughput behavior still match the scope.
- Agree the retainer scope, response expectations and review cadence in writing before support starts.

