BETA

API

Generality

The api base endpoint is http://UPLOADER-HOST:18080

You can get your UPLOADER-HOST on your website configuration page. Be carefull, if you own multiple website, it can be different for each website.

GET parameters must always be specified via the URL query string.

For now, the API is a bit restrictive : you can't do multiple API call at the same time. So you can't trigger the parsing or delete an uploaded log while you are already uploading a log; you can't upload multiple logs in parallel.

Also, if you triggered a site reset or removed a bot via the website, the API will be locked until the pending operation is totally done.

Upload

Used to upload logs on the server. Once a successfull upload call is done, the log is stored on the server and available for parsing (which your trigger yourself using parse api call).

You must do a PUT http request on the endpoint. It is raw upload : the uploaded data basically contains a compressed log without any kind of encoding. (so no url encode and no multipart upload, just the log file).

Endpoint

PUT http://UPLOADER-HOST:18080/upload

headers
X-Upload-Key mandatory Your Upload Key, you can get it on your website configuration page.
Content-Type mandatory Must always be set to application/octet-stream.
GET parameters
compress mandatory Possibles values : gzip bzip rar zip none.
crc32 optional crc32 of the uploaded file. Not mandatory but highly recommanded.
filename optional For informational purpose.
Output

ok on success, an error message otherwise.

Example
curl -T /path/to/log.gz \
-H "Content-Type: application/octet-stream" \
-H "X-Upload-Key: UPLOAD-KEY" \
"http://UPLOADER-HOST:18080/upload?compress=gzip&filename=srv01-20-12-2010.gz"
                

Parse

Used to trigger a parsing of the unparsed uploaded logs.

You must do a GET http request on the endpoint.

Endpoint

GET http://UPLOADER-HOST:18080/parse

headers
X-Upload-Key mandatory Your Upload Key, you can get it on your website configuration page.
GET parameters
checkOnly optional Do not analyze the logs but only return the list of uploaded logs available for parsing.
Output

A json encoded message containing :

  • return: success or error.
  • logs: list of uploaded logs sent to the parser with their id, name and upload date.
  • error: an error message on error.
Example
curl -H "X-Upload-Key: UPLOAD-KEY" "http://UPLOADER-HOST:18080/parse"

Delete log

You can delete uploaded log which have not been parsed or set for parsing.

Usefull if you uploaded several times the same logs by error.

You can get a list of deletable logs using the parse call with the checkOnly=true parameter.

Endpoint

GET http://UPLOADER-HOST:18080/delete-log

headers
X-Upload-Key mandatory Your Upload Key, you can get it on your website configuration page.
GET parameters
id mandatory The id of the log you want to delete.
Output

A json encoded message containing :

  • return: success or error.
  • error: an error message on error.
Example
curl -H "X-Upload-Key: UPLOAD-KEY" "http://UPLOADER-HOST:18080/delete-log?id=3"

Scripts & Utils