Documentation forSolarWinds Observability

Send logs over HTTPS

You can send a single set of events to SolarWinds Observability over HTTPS or configure your application to POST logs over HTTPS.

Send a single set of events

  1. In SolarWinds Observability, click Add Data at the top.

  2. In the Add Data dialog, click Logs.

  3. Click Manual Configuration.

  4. Create or select an API ingestion token to use when sending your logs by doing either of the following:

    • Select Generate New Token and enter an Ingestion Token Name, and then click Next.
    • Select Use Existing Token and select an ingestion token from the list, and then click Next.
  5. Select HTTPS and click Next.

  6. To send a single event to SolarWinds Observability, do either of the following:

    • Click Copy button to copy the command to the clipboard. Then paste the copied text in the command line and replace Your log line here with a string containing the log text or events you want to send.

      For non-Linux machines, replace the backslash (\) with the line-continuation character for your command line interface. For example, if using Windows Command Prompt, replace \ with a caret (^).

    • Click the tab for the command line interface you are using and copy the code in the tab. Paste the copied text in the command line and replace the following: 

      • Replace YourApiToken with the ingestion token specified in the Token box.
      • Replace YourLogLine with a string containing the log text or events you want to send.
      • YourHttpsLogsEndpoint with your organization's HTTPS logs collector endpoint. The HTTPS logs collector endpoint is in the form of logs.collector.xx-yy.cloud.solarwinds.com/v1/logs, where xx-yy represents the data center your organization uses. See Data centers and endpoint URIs.
      Linux Bash

      curl --location --request POST \
          "https://YourLogsHttpsEndpoint" \
          --header "Content-Type: application/octet-stream" \
          --header "Authorization: Bearer YourApiToken" \
          --data-raw "YourLogLine"

      Windows Command
      curl --location --request POST ^
          "https://YourLogsHttpsEndpoint" ^
          --header "Content-Type: application/octet-stream" ^
          --header "Authorization: Bearer YourApiToken" ^
          --data-raw "YourLogLine"
      Windows PowerShell
      $header = @{
          Authorization="Bearer YourApiToken"
      } 	
      	
      Invoke-RestMethod -Method Post -Uri "https://YourLogsHttpsEndpoint" `
          -Headers $header `
          -ContentType "application/octet-stream" `
          -Body "YourLogLine"
      
  7. To associate the log with a host or service entity, add an X-Otel-Resource-Attr header to the command with the following value:

    • For host entities: host.id=YourHostEntityId , where YourHostEntityId is your host entity's unique ID.

      The entity ID follows the format e-XXXXXXXXXXXXXXXXXXX and can be found by looking at the URL in your browser when looking at your entity in the Entity Explorer. For example, the entity ID for the entity showing in the Entity Explorer for the following URL is e-1234512345123451234:

      https://my.na-01.cloud.solarwinds.com/123451234512345123/entities/websites/e-1234512345123451234/overview

    • For service entities: service.name=YourServiceId, where the service ID is the service name portion of the service key.

      The service name is also called the entity's service ID, which is visible in the Overview tab of the service entity's Entity Explorer details view.

    For example, the following Linux Bash command associates the log message with the host entity ID e-1234512345123451234.

    curl --location --request POST \
        "https://logs.collector.xx-yy.cloud.solarwinds.com" \
        --header "Content-Type: application/octet-stream" \
        --header "Authorization: Bearer ABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123abcABC123ab" \
        --header "X-Otel-Resource-Attr:host.id=e-1234512345123451234" \
        --data-raw "Example Log Message"
  8. Press Enter to run the command. The log is sent to the Logs Explorer.

  9. Click View Logs to open the Logs Explorer and view the sent event(s).

Send logs from your application

  1. Determine your HTTPS logs collector endpoint and API token.

    • If you already have an API ingestion token available to use, copy the API token in Settings > API Tokens.

    • The HTTPS logs collector endpoint you should use is in the form of logs.collector.xx-yy.cloud.solarwinds.com/v1/logs, where xx-yy represents the data center your organization uses. See Data centers and endpoint URIs.

  2. Configure your application to POST events using the HTTPS logs collector endpoint and API token

    • POST to the HTTPS logs collector endpoint URL.

    • Include the Authorization header Bearer YourApiToken, replacing YourApiToken with the ingestion token specified in the Token box.

    • Include the Content-Type header application/octet-stream.

    • To associate the log with a host or service entity, include X-Otel-Resource-Attr header(s) with the following value:

      • For host entities: host.id=YourHostEntityId , where YourHostEntityId is your host entity's unique ID.

        The entity ID follows the format e-XXXXXXXXXXXXXXXXXXX and can be found by looking at the URL in your browser when looking at your entity in the Entity Explorer. For example, the entity ID for the entity showing in the Entity Explorer for the following URL is e-1234512345123451234:

        https://my.na-01.cloud.solarwinds.com/123451234512345123/entities/websites/e-1234512345123451234/overview

      • For service entities: service.name=YourServiceId, where the service ID is the service name portion of the service key.

        The service name is also called the entity's service ID, which is visible in the Overview tab of the service entity's Entity Explorer details view.

    • Send events as a string of text using the data-raw option.

  3. Click View Logs to open the Logs Explorer and view the logs sent by your application.

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.