Skip to content
NessFlow
Menu

How to export nginx or Apache access logs

Where the files live, which format to confirm before you send anything, how to pull a specific period out, and what daily rotation quietly throws away.

The NessFlow team (Product engineering, NessFlow) · · 2 min read

Screenshot of the Imported log files and detected format screen in NessFlow, on a demo dataset.

A real product screen, rendered on a fictional demo dataset: the figures shown belong to no client.

You run the server, so access is not the hard part. Leaving with the right file, in the right format, covering the right period is.

Where the files live

A stock nginx install writes accesses to /var/log/nginx/access.log. On Apache it is /var/log/apache2/access.log on Debian-family distributions, and /var/log/httpd/access_log on Red Hat-family ones.

If the machine serves several sites, each virtual host usually gets its own file. Check the access_log directive in your nginx configuration, or CustomLog on Apache, to find the one matching the domain you are auditing. Picking the wrong file raises no error at all; it just produces an analysis of somebody else's site.

Confirm the format first

The default format on both servers is called combined. A line looks like this, with the address first, the request in the middle, and the user agent last, in quotes.

203.0.113.10 - - [12/Jul/2026:04:11:02 +0000] "GET /product/ HTTP/1.1" 200 8214 "https://example.com/" "Mozilla/5.0 (compatible; Googlebot/2.1)"

That last field is the one to check. It carries the user agent, so it is the only thing that separates a crawler from a person. The older common format stops at the byte count and omits it: with it, half the value of log analysis disappears, because every hit is counted as human. If your lines stop after the status code and the size, change the log_format directive before you start collecting the period you care about.

Pulling out a period

Rotation compresses yesterday into access.log.1, access.log.2.gz, and so on. A full month therefore lives in thirty-odd files.

Concatenate them oldest first, then compress the result.

zcat -f /var/log/nginx/access.log.*.gz /var/log/nginx/access.log.1 /var/log/nginx/access.log | gzip > logs-july.log.gz

Order does not matter to the analysis, which reads each line's timestamp, but it helps enormously when you open the file to see what you actually got.

What rotation takes with it

The stock logrotate configuration often keeps two weeks. If you want to compare two months, check the rotate value in /etc/logrotate.d/nginx before discovering that the period you asked for was deleted. Raising it costs disk space only, and compressed logs take very little.

Next

The compressed file uploads as is, no need to expand it. The analysis derives crawler traffic, the depth actually reached, and which requested pages answered with an error.

For what can be concluded from that, and where the exercise stops, see our guide to server log analysis, and the log analysis module page.

Screenshot of the Error URLs requested by crawlers screen in NessFlow, on a demo dataset.

tutorial

Getting raw access logs out of shared hosting

With no server access, logs come through a control panel. Here is the checkbox that keeps them, and why some lines belong to other people’s sites.

The NessFlow team · · 2 min read

Screenshot of the Where your log files come from screen in NessFlow, on a demo dataset.

tutorial

Exporting W3C log files from Microsoft IIS

IIS writes a header-driven format whose columns are ticked one by one. Here are the ones that count, and the box that is almost always missing.

The NessFlow team · · 2 min read

Screenshot of the Coverage of the analysed logs screen in NessFlow, on a demo dataset.

tutorial

Getting your Cloudflare logs out with Logpush

Cloudflare answers for your server on a large share of traffic. Here is how to get its own logs, and what origin logs quietly leave out.

The NessFlow team · · 2 min read

Start with a measurement, not a promise

Run an audit on your own site and read what the engine finds. If you would rather be walked through it, book a demo: we run it on your site, with your own URLs on screen.

Access opens in waves: we email you when yours is ready.