This topic describes how to install Logstash to upload log data to Log Service.

Background information

Logstash is an open-source software for collecting data. You can install the logstash-output-logservice plugin to upload data to Log Service. For more information, see Logstash plugin in GitHub.


  1. Install Java
    1. Download the installation package.

      Go to the Java official website to download JDK for installation.

    2. Sets the environment variable.

      Add or modify environment variables in advanced system settings.

      • PATH: C:\Program Files\Java\jdk1.8.0_73\bin
      • CLASSPATH:C:\Program Files\Java\jdk1.8.0_73\lib;C:\Program Files\Java\jdk1.8.0_73\lib\tools.jar
      • JAVA_HOME:C:\Program Files\Java\jdk1.8.0_73
    3. Perform verification.

      Run PowerShell or cmd.exe for verification.

      PS C:\Users\Administrator> java -version
      java version "1.8.0_73"
      Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)
      PS C:\Users\Administrator> javac -version
      javac 1.8.0_73
  2. Install Logstash
    1. Download the installation package from the official website Logstash.
      • We recommend that you download v 5.0 or any later versions of Logstash.

      • Logstash v 6.4.3 can be installed can operates normally in the following operating systems: Mac OS 10.14.1, Windows 7, and Linux (CentOS 7).

    2. Install Logstash.
  3. Install the plug-in used by Logstash to write logs to Log Service
    Install the plug-in online or offline based on the network environment where the machine resides.
    • Online installation

      The plug-in is hosted by RubyGems. For more information, see here .

      Run PowerShell or cmd.exe to go to the Logstash installation directory.
      PS C:\logstash-6.4.3> .\bin\plugin install logstash-output-logservice
    • Offline installation

      Download from the official website. Go to the logstash-output-logservicepage and click Download in the lower-right corner.

      If the machine from which logs are collected cannot access the Internet, copy the downloaded gem package to your local directory. Run PowerShell or cmd.exe to go to the Logstash installation directory. Perform the following command to install lLogstash:
      PS C:\logstash-6.4.3> .\bin\plugin install C:\logstash-6.4.3\logstash-output-logservice-0.4.0.gem
    • Perform verification.
      PS C:\logstash-6.4.3> .\bin\plugin list

      Verify that logstash-output-logservice exists in the installed plug-in list of the machine.