All Tools View Categories About Contact Privacy

Log Rotation Splitter

Simulate logrotate: cut a log into a rolling set of rotated files.

Runs entirely in your browser — your logs never leave this page.
Rotations older than this are dropped, like logrotate backup count.
0
total lines
0
rotations
0 B
input size
0 B
largest chunk

About Log Rotation Splitter

On a production box, logrotate quietly turns one unstoppable log into a rolling stack of files: app.log holds the newest lines, app.log.1 the previous batch, app.log.2 the batch before that, and so on out to a configured keep count. Log Rotation Splitter reproduces exactly that layout in the browser, turning a large pasted log into a simulated rotated file set so you can study or reproduce the behavior without touching a server, writing a cron job, or waiting for a real rotation to happen.

Pick a rotation trigger — a maximum line count per chunk or a maximum size per chunk in kilobytes — and the tool walks your log from start to finish, cutting it into rotation-sized pieces. Every original line ends up in exactly one chunk: none are dropped, none are duplicated, and a line is never split across a chunk boundary, even in size mode where a single very long line can legitimately push a chunk slightly over the target. The newest chunk keeps the base file name, older chunks get numeric suffixes counting upward with age, and a Keep count drops everything older than your rotation window from the output, just like backup count in real logrotate configuration.

Every chunk in the result shows its own line count and byte size, and can be copied or downloaded individually under its rotated file name, or you can grab the whole set in one click. Because the tool works purely on the text you paste in, you can experiment freely with different rotation triggers and keep counts to see exactly how a given log would be sliced before committing to a real rotation policy on a server.

Features

  • Simulate logrotate — base file plus .1, .2 suffix layout, newest to oldest.
  • Rotate by line count — cut every N lines into its own chunk.
  • Rotate by chunk size — cut chunks once they reach a target size in KB, measured in real UTF-8 bytes.
  • Keep count — caps the rotation window and drops older chunks, mirroring backup count.
  • Never cuts a line — chunks always break at line boundaries, so no record is ever mangled mid-line.
  • Full coverage — every input line, including blank lines, lands in exactly one output chunk with nothing dropped.
  • Per-chunk copy and download under the real rotated file names.
  • Download all — grab the entire simulated rotation set in one click.
  • Summary cards — total lines, rotation count, input size, and largest chunk size.
  • 100% local — nothing leaves the browser, no upload, no server round trip.

How to Use

  1. Paste your log into the text box — the larger and more realistic, the more useful the simulation.
  2. Set the rotation trigger. Choose Line count to rotate every N lines, or Size (KB) to rotate once a chunk reaches a target size.
  3. Enter the rotation value — lines per chunk, or kilobytes per chunk, depending on the trigger you picked.
  4. Set the keep count to cap how many rotations survive in the output, just like logrotate’s backup count.
  5. Name the base file if you want the output to match a real file name, such as app.log.
  6. Simulate rotation. The rolling file set is listed in order from oldest to newest, each labeled with its rotated name.
  7. Review and export. Copy or download each rotated file individually, or download the whole set at once.

Examples

Example 1 — Reproduce server layout. Your on-call docs say to expect app.log plus app.log.1 through app.log.3. Paste a production export, set rotate-by-size at 1 MB and keep 4, and obtain exactly that five-file rotation set to hand to a teammate as a realistic fixture.

Example 2 — Pre-flight a rotation config. Before tuning logrotate on a busy service, paste a day of real traffic and simulate how many rotations it would produce under a few different size and keep settings, so you can pick values that match your actual retention needs instead of guessing.

Example 3 — Delivery shape. A downstream tooling rule expects logs split the way a syslog daemon would rotate them, with numbered suffixes and a bounded window. Generate that exact shape here for test fixtures instead of hand-crafting files.

Example 4 — Verifying full coverage. After simulating a rotation, concatenate the chunks back together in order (oldest to newest) and diff the result against the original paste — every line, including blank ones, should reappear exactly once, confirming the split introduced no gaps or duplicates.

Benefits

  • Faithful logrotate semantics — numbering and keep count behave the way a real rotation would.
  • Predictable triggers — line count or size based, whichever matches how your service actually rotates.
  • Line-boundary safe — no mangled records, ever, even at odd size cutoffs.
  • Complete coverage — every line from the input, blank lines included, appears in exactly one output chunk.
  • Ready-to-use files — download each chunk under its rotated name, ready to drop into a fixture directory.
  • Private — all processing stays local, nothing is ever uploaded.

Frequently Asked Questions

What does a log rotation splitter do?
It simulates what logrotate does to a real file: cut a growing log into rotation-sized chunks so the newest chunk holds the most recent lines and older chunks keep progressively older history, each with a .1, .2 suffix exactly like rotated log files on disk.
How are the rotation names assigned?
The newest chunk keeps the base name (for example app.log). The chunk before it becomes app.log.1, the one before that app.log.2, and so on, mirroring how a real logrotate keeps a rolling window of files.
What triggers a rotation?
Two configurable triggers: a maximum line count per rotation (rotate every N lines) or a maximum size per rotation (rotate when a chunk reaches N KB). Lines are never split in the middle of a line.
Is the oldest chunk kept forever?
No. A Keep count setting caps how many rotated files remain, just like backup count in logrotate. Files older than the keep count are dropped in the output.
When would I use this?
To test log-rotation behavior on a sample before configuring a server, to study how line counts map to file sizes, or to turn one oversized file into the rotating-file layout your on-call docs describe.
Does it rotate my real files?
No. Everything stays inside the browser. You paste text, you download the resulting simulated rotation set as separate files.