Send Sample Data to Loggly using PowerShell

I’ve been investigating the viability of logging from PowerShell scripts to Loggly, and I came across their “Send Sample Data to Loggly” intro page. They instruct Windows users to install and use cURL to send their data to the API, but this isn’t necessary if you have PowerShell 3.0 or newer.

Just run the following one-liner in a PowerShell console window:

(wget "").RawContent | iwr -Method Post -Uri "" -ContentType "text/plain" 

Note: ‘iwr’ and ‘wget’ as used above are both aliases for the Invoke-WebRequest cmdlet:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s