Free plan

Parse logs

Turn a server log file into a table you can filter and count
POST
/v1/data/logs

About this tool

A log file is a long text record that a website or program writes as it runs. This tool reads it, splits each line into columns with real dates, and lets you keep only some lines, by time, status, level or text. It can also add a summary, such as the busiest pages and requests per hour.
For example, you find how many errors your website had in each hour yesterday.

How to use it

  1. Choose this tool.
  2. Add your log file with Upload or drag and drop.
  3. Leave the log type on automatic, or pick it if it is not recognised.
  4. Set filters such as a time range, a status or a word, and switch on the summary if you want it, then press Generate.
  5. Download the table.

What you get back

You get a table of log lines, optionally with a summary. Download it and open it in a spreadsheet.
GOOD TO KNOW
With format auto, the first 50 lines decide. A custom pattern is run line by line with the usual safeguards. Counts as one conversion.
TEST IT LIVE

Try Parse logs in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Data
Plan
Free
Method
POST
Endpoint
/v1/data/logs
Tool ID
data.logs
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Data
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/data/logs" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'format=auto' \
  -F 'pattern=(?<ip>\S+) (?<msg>.*)' \
  -F 'year=1970'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.data.logs({
    "file": 'document.pdf',
    "format": "auto",
    "pattern": "(?<ip>\\S+) (?<msg>.*)",
    "year": 1970
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->data()->logs([
    'file' => 'document.pdf',
    'format' => 'auto',
    'pattern' => '(?<ip>\\S+) (?<msg>.*)',
    'year' => 1970,
]);
echo $result->requestId;
FAQ

Frequently asked questions

Read a log file (Apache / nginx access log, syslog, JSON lines, logfmt or your own pattern) into a table with real dates, the request split into method and path, and numbers; filter by time, status, level or text; add a summary of the busiest paths, addresses and statuses, the bytes and the requests per hour.

Parse logs works from text and settings, so no file is needed. Every input is optional.

Parse logs is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/data/logs with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.