Skip to main content

cURL

cURL is a command line utility for transferring data, useful for testing configurations or troubleshooting connectivity to Logz.io. You can upload JSON or plain text files.

Send plain text as a JSON payload

  1. Download cURL.

  2. To send a single text log line using cURL, use the following command. This sends your message as a JSON payload:

curl --location 'https://listener.logz.io:8071?token=<<SHIPPING_TOKEN>>&type=text' \
--header 'Content-Type: application/json' \
--data '{"<<test>>": "<<support>>"}'

Replace <<SHIPPING_TOKEN>> with your account's shipping token.

This method sends a JSON-formatted string, where the text is treated as the log message content.

  1. View your logs

Allow some time for data ingestion, then open Explore.

Upload a JSON log file

Limitations

  • Max body size: 10 MB (10,485,760 bytes).
  • Max log line size: 500,000 bytes.
  • Type field in the log overrides the type in the request header.
  1. Download cURL.

  2. Upload the file:

cat /path/to/log/file | curl -X POST "https://<<LISTENER-HOST>>:8071?token=<<LOG-SHIPPING-TOKEN>>&type=<LOG-TYPE>" \
-H "user-agent:logzio-curl-logs" \
-v --data-binary @-

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<LOG-SHIPPING-TOKEN>> with the token of the account you want to ship to.

  • Replace <<LISTENER-HOST>> with the host for your region.

  • Declare your log type for parsing purposes. Logz.io applies default parsing pipelines to the following list of built-in log types. If you declare another type, contact support for assistance with custom parsing. Can't contain spaces. Otherwise, the default type is http-bulk.

  1. View your logs

Allow some time for data ingestion, then open Explore.

Encounter an issue? See our log shipping troubleshooting guide.

Upload a plain text log file

Limitations

  • Max body size: 30 MB (31,457,280 bytes).
  • Type field in the log overrides the type in the request header.
  1. Download cURL.

  2. Upload the file:

curl -T /path/to/log/file https://<<LISTENER-HOST>>:8022/file_upload/<<LOG-SHIPPING-TOKEN>>/<<LOG-TYPE>> \
-H "user-agent: logzio-curl-logs"

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<LOG-SHIPPING-TOKEN>> with the token of the account you want to ship to.

  • Declare your log type for parsing purposes. Logz.io applies default parsing pipelines to the following list of built-in log types. If you declare another type, contact support for assistance with custom parsing. Can't contain spaces. Otherwise, the default type is http-bulk.

  1. View your logs

Allow some time for data ingestion, then open Explore.

Encounter an issue? See our log shipping troubleshooting guide.