Invoke-RestMethod is a command to interact with REST APIs in PowerShell. Invoke-RestMethod is a quick and easy way to test your configuration or troubleshoot your connectivity to Logz.io.
You can upload JSON or plain text files.
- Max body size is 10 MB (10,485,760 bytes)
- Each log line must be 500,000 bytes or less
- If you include a
typefield in the log, it overrides
typein the request header
Upload a JSON log file
Before you begin, you'll need: PowerShell
Upload the file
If you want to ship logs from your code but don't have a library in place, you can send them directly to the Logz.io listener as a minified JSON file.
Invoke-RestMethod -method POST -Uri https://<<LISTENER-HOST>>:8071?token=<<LOG-SHIPPING-TOKEN>>"&"<<LOG-TYPE>> -InFile <<PATH/TO/LOG/FILE.JSON>>
Replace the placeholders to match your specifics. (They are indicated by the double angle brackets
<<LOG-SHIPPING-TOKEN>>with the token of the account you want to ship to.
<<LISTENER-HOST>>with the host for your region. For example,
listener.logz.ioif your account is hosted on AWS US East, or
listener-nl.logz.ioif hosted on Azure West Europe. The required port depends whether HTTP or HTTPS is used: HTTP = 8070, HTTPS = 8071.
- 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
<<PATH/TO/LOG/FILE.JSON>>with the path to your log file.
Check Logz.io for your logs
Give your logs some time to get from your system to ours, and then open Open Search Dashboards.
If you still don't see your logs, see log shipping troubleshooting.