Documentation forLoggly

File Upload

Loggly provides the infrastructure to aggregate and normalize log events so they are available to explore interactively, build visualizations, or create threshold-based alerting. In general, any method to send logs from a system or application to an external source can be adapted to send logs to Loggly. The following instructions provide one scenario for sending logs to Loggly.

The easiest way to get data into Loggly for a quick test is to upload a single file. To continuously monitor a file on production systems please use file monitoring instead. File upload assumes you are uploading text logs where each line is an event, with one of our timestamp formats if you need timestamps, or with one of our accepted Log Types if you need parsed messages. You can send up to a maximum of 100MB per file, 1MB per event, with no timestamps or parsable timestamps within last 7 days.

The following file types are not supported:
.bin, .exe, .lib, .dat, .mp3, .gif, .jpg, .jpeg, .bmp, .zip, .gz, .tar, .dll, .png, .img, .db, .lib, .pdf, .mp4, .mpeg, .mov, .jar, .pem, .crt, .doc, .xls, .xlsx, .docx, .ppt, .pptx, .dmg, .rar, .apk, and .7z

Linux or Mac Environment

1. Send Data

Paste the following command into the terminal window, then run it to upload the sample data to your account.

curl -X POST -T FILE.TXT https://logs-01.loggly.com/bulk/TOKEN/tag/file_upload 

Replace:

  • FILE.TXT: enter the location of the log file you wish to read to the server
  • TOKEN: enter your customer token from the source setup page

file-upload-terminal
You should get the response ok code.

2. Verify

Search Loggly over the past hour for the file_upload tag to see your log events:

tag:file_upload 

file upload

Windows Environment

1. Download cURL

Download the latest version of cURL for use on your Windows machine from the cURL website. Be sure to unzip the cURL files to a directory that is easy to access (e.g. c:\curl\).

2. Send Data

Open the Command Prompt program from the Start menu, then change to the curl installation directory.

cd c:\curl

Paste the following command into the terminal window, then run it to upload the sample data to your account.

curl -X POST -T FILE.TXT https://logs-01.loggly.com/bulk/TOKEN/tag/file_upload

Replace:

  • FILE.TXT: enter  the location of the log file you wish to read to the server.
  • TOKEN: enter your customer token from the source setup page

3. Verify

Search Loggly over the past hour for your tag to see your log events:

tag:file_upload 

Troubleshooting

If you don’t see any data in Loggly, check for these common problems:

  • Wait a few minutes in case indexing needs to catch up
  • Check the search page over the past day in case the timestamps are different from the current UTC time
  • Make sure you sent data within the limits of 100MB max file size, 1MB per event, with no timestamps or parsable timestamps within last 7 days.
  • Remember to replace the filename and your token before using the curl command
  • If you are on Windows Server 2012/16 then you may see the error below:
    curl: (60) SSL certificate problem: self signed certificate in certificate chain
    More details here: https://curl.haxx.se/docs/sslcerts.html
    			
    curl failed to verify the legitimacy of the server and therefore could not
    establish a secure connection to it. To learn more about this situation and
    how to fix it, please visit the web page mentioned above. 

    To fix this, you have to download the cacert.pem file from this link and then you should copy this file to the location where your curl.exe file exists. Next you have to rename the cacert.pem file to "curl-ca-bundle.crt". Make sure your curl.exe and this certificate file remain in the same folder. Now just retry sending logs using curl and you should see the response below:

    {"response" : "ok"} 

Still Not Working?

The scripts are not supported under any SolarWinds support program or service. The scripts are provided AS IS without warranty of any kind. SolarWinds further disclaims all warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The risk arising out of the use or performance of the scripts and documentation stays with you. In no event shall SolarWinds or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the scripts or documentation.