Parse logs
About this tool
How to use it
- Choose this tool.
- Add your log file with Upload or drag and drop.
- Leave the log type on automatic, or pick it if it is not recognised.
- Set filters such as a time range, a status or a word, and switch on the summary if you want it, then press Generate.
- Download the table.
What you get back
Try Parse logs in the Studio
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;