# Apache Access Log to CSV: IP, Path, Status, Bytes

**Use case:** 

Turn raw Apache or nginx access log lines into a table with one row per request: IP, timestamp, method, path, status code, bytes, referer and user agent. This example parses four pasted lines and saves a CSV and an Excel file. Paste your own log lines to convert them.

## Input

```json
{
  "text": "203.0.113.5 - - [15/Jan/2024:10:30:01 +0000] \"GET /index.html HTTP/1.1\" 200 5123 \"https://example.com/\" \"Mozilla/5.0\"\n203.0.113.9 - alice [15/Jan/2024:10:30:07 +0000] \"POST /api/login HTTP/1.1\" 302 0 \"-\" \"curl/8.4.0\"\n198.51.100.23 - - [15/Jan/2024:10:31:12 +0000] \"GET /missing.png HTTP/1.1\" 404 196 \"https://example.com/blog\" \"Mozilla/5.0\"\n198.51.100.23 - - [15/Jan/2024:10:31:40 +0000] \"GET /pricing HTTP/2.0\" 500 1024 \"-\" \"Googlebot/2.1\"\n",
  "mode": "log",
  "delimiter": "auto",
  "quoteHandling": "auto",
  "regexScope": "perLine",
  "regexIgnoreCase": false,
  "linesLayout": "rows",
  "logFormat": "auto",
  "keyValueSeparator": "auto",
  "tableNumber": 1,
  "headerRow": "auto",
  "skipLines": 0,
  "trim": true,
  "skipBlankLines": true,
  "inferTypes": true,
  "inferBooleans": true,
  "inferDates": true,
  "maxRows": 100000,
  "encoding": "auto",
  "includeSource": false,
  "maxFileSizeMb": 50,
  "outputFormats": [
    "csv",
    "xlsx"
  ],
  "outputEncoding": "utf-8-sig",
  "outputDelimiter": "comma",
  "quoteAllFields": false,
  "escapeFormulas": true
}
```

## Output

```json
{
  "_source": {
    "label": "Source",
    "format": "string"
  },
  "id": {
    "label": "id"
  },
  "name": {
    "label": "name"
  },
  "city": {
    "label": "city"
  },
  "amount": {
    "label": "amount"
  },
  "joined": {
    "label": "joined"
  },
  "active": {
    "label": "active"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Text to CSV Converter: Turn Text, Tables & Logs into CSV Actor is ready to run with the inputs already set for "Apache Access Log to CSV: IP, Path, Status, Bytes". [Sign up or log in](https://console.apify.com/create-task-from-example/e8F22sqKlNczjrEFv) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Apache Access Log to CSV: IP, Path, Status, Bytes" task

The Text to CSV Converter: Turn Text, Tables & Logs into CSV Actor will start running based on the input automatically. You can also change all the input fields, like text to convert, mode, and more, to match your specific use case.

### 3. Receive the "Apache Access Log to CSV: IP, Path, Status, Bytes" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as source, id, name, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Apache Access Log to CSV: IP, Path, Status, Bytes" task via API](https://apify.com/data-done-right/text-to-csv-converter.md).

## About this Actor

This example demonstrates how to use [Text to CSV Converter: Turn Text, Tables & Logs into CSV](https://apify.com/data-done-right/text-to-csv-converter.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/data-done-right/text-to-csv-converter.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/data-done-right/text-to-csv-converter.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
