Install Agent on Host

BLS

  • Function Release Records
  • Product Description
    • Usage restrictions
    • Product Introduction
  • Product pricing
  • Quick Start
    • Introduction
    • Install agent
    • Create LogStore
    • Create Transmission Task
    • Log Analysis and Alerting
    • Create Delivery Task
  • Operation guide
    • Baidu Intelligent Cloud Environment Preparation
    • Overview
    • Identity and access management
    • Logset Management
    • Agent
      • Install Agent on Host
      • Install Agent in K8s Environment
      • Agent Management
      • Agent Release Version
      • Set Agent Startup Parameters
    • Log Collection
      • Transmission Task Collection
        • Create Transmission Task
        • Manage Transmission Task
      • Uploading Logs Using Kafka Protocol
    • Query analysis
      • Log query
      • SQL Syntax
      • Search Syntax
    • Dashboard
      • Overview
      • Management Dashboard
      • Management Dashboard Charts
    • Alarm management
      • Alert Overview
      • Alarm strategy
        • Management alarm strategy
        • Trigger conditions
      • Alarm history
      • Alert execution statistics
      • Alarm notification
        • Alarm Notification Template
        • Alarm callback
    • Data processing
      • Log Delivery
        • Log Delivery Overview
        • Create Delivery Task
        • Manage Delivery Task
      • Scheduled SQL Analysis
        • Manage Scheduled SQL Analysis Task
        • Create Scheduled SQL Analysis Task
      • Real-Time Consumption
      • Data processing
        • Data processing
          • Overview of data processing functions
          • Process control function
          • Mapping enrichment functions
          • Event operation functions
          • Field operation functions
          • Field value extraction functions
    • Log Applications
      • Intelligent Diagnostics
  • Best Practices
    • Use Year-Over-Year and Month-Over-Month as Alert Trigger Conditions
    • BLS Integration with Kibana
    • Use BLS via Grafana
  • Development Guide
    • API Reference
      • API function release records
      • API Overview
      • Interface Overview
      • General Description
      • Service domain
      • Common error codes
      • Terminology
      • Project Related APIs
        • Create Project
        • Update Project
        • Describe Project
        • Delete Project
        • List Project
      • LogStore Related APIs
        • Create LogStore
        • Update LogStore
        • Delete LogStore
        • Describe LogStore
        • Batch Get LogStore
        • List LogStore
      • LogStream Related APIs
        • List LogStream
      • LogRecord Related APIs
        • Push log PushLogRecord
        • Obtain logrecord PullLogRecord
        • Search analysis log QueryLogRecord
        • Histogram API QueryLogHistogram
      • Fast Query FastQuery Related Interfaces
        • Create Fast Query CreateFastQuery
        • Update Fast Query UpdateFastQuery
        • Delete Fast Query DeleteFastQuery
        • Get Fast Query Details DescribeFastQuery
        • Get Fast Query List ListFastQuery
      • Index Related APIs
        • Create Index
        • Update Index
        • Delete Index
        • Describe Index
      • Log Shipper LogShipper Related Interfaces
        • Create Log Shipper
        • Update Log Shipper
        • Set Single Log Shipper Status
        • Delete Single Log Shipper
        • Bulk Delete Log Shipper
        • List Log Shipper Records
        • List Log Shipper
        • Bulk Set Log Shipper Status
        • Get Log Shipper
      • Alarm-Related Interfaces
        • CreateAlarmPolicy
        • UpdateAlarmPolicy
        • DeleteAlarmPolicy
        • ValidateAlarmCondition
        • ValidateAlarmPolicySQL
        • EnableAlarmPolicy
        • DescribeAlarmRecord
        • DisableAlarmPolicy
        • DescribeAlarmPolicy
        • ListAlarmPolicy
        • ListAlarmRecord
        • ListAlarmExecutionStats
        • ListAlarmExecutions
      • LogStore Template-Related Interfaces
        • CreateLogStoreTemplate
        • UpdateLogStoreTemplate
        • DeleteLogStoreTemplates
        • DescribeLogStoreTemplates
        • DescribeLogStoreTemplate
      • Download Log Download Related Interfaces
        • Create Download Task CreateDownloadTask
        • Get Download Task List ListDownloadTask
        • Delete Download Task DeleteDownloadTask
        • Get Download Task Address GetDownloadTaskLink
        • Get Download Task Details DescribeDownloadTask
      • LogAlarm Related Interfaces
        • SetLogAlarmStatus
        • deleteLogAlarm
        • createLogAlarm
        • listLogAlarm
        • updateLogAlarm
        • BulkDeleteLogAlarm
        • PreviewAlarmLogRecord
        • getLogAlarm
        • BulkSetLogAlarmStatus
      • Transmission Task Related Interfaces
        • Create Task CreateTask
        • UpdateTask
      • Interfaces Compatible with Elasticsearch
        • ResolveIndex
        • FieldCaps
        • TermsEnum
        • AsyncSearch
    • SDK Reference
      • Go SDK
        • Overview
        • Initialization
        • Version Release Records
        • Project Operations
        • LogStore Operations
        • Install the SDK Package
        • LogStream Operations
        • LogRecord Operations
        • FastQuery Operations
        • LogShipper Operations
        • Index Operations
        • Download Task Operations
      • Java SDK
        • Overview
        • Install the SDK Package
        • LogRecord Operations
      • iOS SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android & iOS SDK Download
      • SDK Privacy Policy
      • SDK Developer Personal Information Protection Compliance Guide
    • Importing SLS Collection Configuration
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
  • Log Service Level Agreement SLA
All documents
menu
No results found, please re-enter

BLS

  • Function Release Records
  • Product Description
    • Usage restrictions
    • Product Introduction
  • Product pricing
  • Quick Start
    • Introduction
    • Install agent
    • Create LogStore
    • Create Transmission Task
    • Log Analysis and Alerting
    • Create Delivery Task
  • Operation guide
    • Baidu Intelligent Cloud Environment Preparation
    • Overview
    • Identity and access management
    • Logset Management
    • Agent
      • Install Agent on Host
      • Install Agent in K8s Environment
      • Agent Management
      • Agent Release Version
      • Set Agent Startup Parameters
    • Log Collection
      • Transmission Task Collection
        • Create Transmission Task
        • Manage Transmission Task
      • Uploading Logs Using Kafka Protocol
    • Query analysis
      • Log query
      • SQL Syntax
      • Search Syntax
    • Dashboard
      • Overview
      • Management Dashboard
      • Management Dashboard Charts
    • Alarm management
      • Alert Overview
      • Alarm strategy
        • Management alarm strategy
        • Trigger conditions
      • Alarm history
      • Alert execution statistics
      • Alarm notification
        • Alarm Notification Template
        • Alarm callback
    • Data processing
      • Log Delivery
        • Log Delivery Overview
        • Create Delivery Task
        • Manage Delivery Task
      • Scheduled SQL Analysis
        • Manage Scheduled SQL Analysis Task
        • Create Scheduled SQL Analysis Task
      • Real-Time Consumption
      • Data processing
        • Data processing
          • Overview of data processing functions
          • Process control function
          • Mapping enrichment functions
          • Event operation functions
          • Field operation functions
          • Field value extraction functions
    • Log Applications
      • Intelligent Diagnostics
  • Best Practices
    • Use Year-Over-Year and Month-Over-Month as Alert Trigger Conditions
    • BLS Integration with Kibana
    • Use BLS via Grafana
  • Development Guide
    • API Reference
      • API function release records
      • API Overview
      • Interface Overview
      • General Description
      • Service domain
      • Common error codes
      • Terminology
      • Project Related APIs
        • Create Project
        • Update Project
        • Describe Project
        • Delete Project
        • List Project
      • LogStore Related APIs
        • Create LogStore
        • Update LogStore
        • Delete LogStore
        • Describe LogStore
        • Batch Get LogStore
        • List LogStore
      • LogStream Related APIs
        • List LogStream
      • LogRecord Related APIs
        • Push log PushLogRecord
        • Obtain logrecord PullLogRecord
        • Search analysis log QueryLogRecord
        • Histogram API QueryLogHistogram
      • Fast Query FastQuery Related Interfaces
        • Create Fast Query CreateFastQuery
        • Update Fast Query UpdateFastQuery
        • Delete Fast Query DeleteFastQuery
        • Get Fast Query Details DescribeFastQuery
        • Get Fast Query List ListFastQuery
      • Index Related APIs
        • Create Index
        • Update Index
        • Delete Index
        • Describe Index
      • Log Shipper LogShipper Related Interfaces
        • Create Log Shipper
        • Update Log Shipper
        • Set Single Log Shipper Status
        • Delete Single Log Shipper
        • Bulk Delete Log Shipper
        • List Log Shipper Records
        • List Log Shipper
        • Bulk Set Log Shipper Status
        • Get Log Shipper
      • Alarm-Related Interfaces
        • CreateAlarmPolicy
        • UpdateAlarmPolicy
        • DeleteAlarmPolicy
        • ValidateAlarmCondition
        • ValidateAlarmPolicySQL
        • EnableAlarmPolicy
        • DescribeAlarmRecord
        • DisableAlarmPolicy
        • DescribeAlarmPolicy
        • ListAlarmPolicy
        • ListAlarmRecord
        • ListAlarmExecutionStats
        • ListAlarmExecutions
      • LogStore Template-Related Interfaces
        • CreateLogStoreTemplate
        • UpdateLogStoreTemplate
        • DeleteLogStoreTemplates
        • DescribeLogStoreTemplates
        • DescribeLogStoreTemplate
      • Download Log Download Related Interfaces
        • Create Download Task CreateDownloadTask
        • Get Download Task List ListDownloadTask
        • Delete Download Task DeleteDownloadTask
        • Get Download Task Address GetDownloadTaskLink
        • Get Download Task Details DescribeDownloadTask
      • LogAlarm Related Interfaces
        • SetLogAlarmStatus
        • deleteLogAlarm
        • createLogAlarm
        • listLogAlarm
        • updateLogAlarm
        • BulkDeleteLogAlarm
        • PreviewAlarmLogRecord
        • getLogAlarm
        • BulkSetLogAlarmStatus
      • Transmission Task Related Interfaces
        • Create Task CreateTask
        • UpdateTask
      • Interfaces Compatible with Elasticsearch
        • ResolveIndex
        • FieldCaps
        • TermsEnum
        • AsyncSearch
    • SDK Reference
      • Go SDK
        • Overview
        • Initialization
        • Version Release Records
        • Project Operations
        • LogStore Operations
        • Install the SDK Package
        • LogStream Operations
        • LogRecord Operations
        • FastQuery Operations
        • LogShipper Operations
        • Index Operations
        • Download Task Operations
      • Java SDK
        • Overview
        • Install the SDK Package
        • LogRecord Operations
      • iOS SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android SDK
        • Overview
        • Quick start
        • Version Release Records
      • Android & iOS SDK Download
      • SDK Privacy Policy
      • SDK Developer Personal Information Protection Compliance Guide
    • Importing SLS Collection Configuration
  • FAQs
    • Common Questions Overview
    • Fault-related questions
    • Configuration-related questions
  • Log Service Level Agreement SLA
  • Document center
  • arrow
  • BLS
  • arrow
  • Operation guide
  • arrow
  • Agent
  • arrow
  • Install Agent on Host
Table of contents on this page
  • Installation steps
  • Examples and explanations of installation commands.
  • Linux environment:
  • Windows environment:
  • How to deploy tasks simultaneously during agent installation
  • Linux environment
  • Windows environment
  • Update the agent
  • Linux environment
  • Windows environment
  • Uninstall the agent
  • Linux environment
  • Windows environment
  • Windows system ZIP installation method

Install Agent on Host

Updated at:2025-11-03

The agent is a service component provided by log service and installed on hosts. After installation, the agent will listen to specified files, collect log file contents, and delivery them to the destination address. The agent currently supports 64-bit Linux and Windows systems and only supports collecting UTF-8 encoded files. If you encounter installation issues, please submit a Ticket for assistance.

Installation steps

  1. Sign in to Baidu AI Cloud Console search for Baidu AI Cloud Log Service (BLS), and access the log service page.
  2. Users must activate Baidu AI Cloud Log Service (BLS) before using it for the first time. Click the Activate Service button to proceed.
  3. Click on Agent in the left navigation menu, then select Agent Installation to access the installation page.
  4. The system automatically generates a certification token and creates an installation command linked to this token and operating system. Use the command to install the log service agent on your host. BLS supports CentOS, Ubuntu, and Debian systems. Select your OS and click the Copy button to copy the installation command.

image.png

Note: If the Copy button for the installation command is not displayed, please refer to FAQ: Why is the Copy button for the installation command not displayed in the browser?

Note: Installation commands vary by regions. Please obtain the accurate installation command from the console

Paste the installation command into a Linux shell or Windows PowerShell to execute it.

Examples and explanations of installation commands.

Linux environment:

  1. Command example
Shell
1bash -c "$(wget -qO - <repo address>)" '' -o <token value> -s <OS version> -p /opt -u root

In this command,

represents the installation script repo address, which varies by regions

represents the user's unique certification identifier on the BLS server

refers to the version of the installed system, such as CentOS, Ubuntu, or Debian.

Note: Do not manually modify the above parameters

-p specifies the directory for installing the agent, with /opt as the default. After installation, a logbeat directory will be created in the chosen directory. If a logbeat directory already exists there, the script will prompt whether to overwrite the existing directory (y/n). If you opt not to overwrite, select No (n), then reinstall and specify a different installation directory.

-u specifies the local user, with the default set to root.

You can adjust these two parameters to specify the installation directory and the local user.

Note: The last parameter specifies the local user running the agent, which may differ from the user executing the installation command. Difference: One user installs the agent (e.g., root), and the other user starts the agent (e.g., work).

Note: Multiple agents can be installed on the same machine by specifying different installation directories. These agents operate independently, but only one agent should be installed with a token logically. It is allowed to install multiple agents on a single machine, for use by different users.

  1. Log in to your host and execute the installation command under root permission. At this point, if the local execution account does not exist, the installation script will create one and use it to start the agent. Execute installation commands with root permission. The script will add system service commands: service logbeatd [start/stop/status/restart] and service to start automatically at boot. Service commands can be used to start, stop, and view processes.
  2. You can install the agent with a non-root user as well. Keep in mind that unlike the root user installation, the installation script will not add the service command or enable the service to start automatically at boot. To start or stop logbeat at this stage, use the start.sh and stop.sh scripts located in the bin directory of the logbeat installation folder. These scripts must be run by the user operating the process.

    Note: After starting the agent with your designated local account, ensure the account has read access to target files and read/execute permissions for all parent directories.

  3. Follow the on-screen prompts to confirm successful agent installation.

Windows environment:

  1. Command example
Powershell
1powershell -c "(New-Object System.Net.WebClient).DownloadFile('<repo address>', 'install-logbeat.bat')" ; start -FilePath install-logbeat.bat "<token>"

In this command, represents the user’s unique certification identifier on the BLS server, which cannot be modified by users. The agent installation directory is C:\Program Files\Baidu\Logbeat, and it must be installed using the administrator user.

  1. After installation, a logbeat service named: "Baidu Logebat Service" is registered in the system.
  2. Under the installation directory, scripts such as start.bat/stop.bat/status.bat/install.bat/uninstall.bat are available for starting/stopping, viewing, registering, and uninstalling the service.
  3. Follow the on-screen prompts to confirm successful agent installation.
  4. Additionally, Windows supports custom installation via zip packages. Refer to Windows System Zip Installation Method.

How to deploy tasks simultaneously during agent installation

If you wish to package the agent provided by log service into an image file for rapid deployment of servers with the same configuration, please create a transmission task in advance and add task parameters during installation, as detailed below:

  1. In the Agent Installation page, select the corresponding OS and copy the installation command
  2. Find and select the transmission tasks you want to pre-configure in the transmission task list page, and record their task IDs
  3. Add these task IDs as task parameters at the end of the installation command in the following format:

Linux environment

Shell
1bash -c "$(wget -qO - <repo address>)" '' -o <token value> -s <OS version> -p /opt -u root -t task1ID,task2ID,task3ID...

Description:

a) The parameter indicator for the task ID list is -t
b) Multiple tasks are separated by “,” without spaces
c) Only support transmission task IDs created under your account; you cannot add transmission task tasks created by others
d) Incorrect transmission task IDs do not affect normal operation of the agent

Example:

Install the agent on an Ubuntu host and deploy two transmission tasks

Shell
1bash -c "$(wget -qO - <repo address >)" '' -o cdda****5880 -s ubuntu -p /opt -u root -t 3482****4b6a,b5b6****2c93

Windows environment

Powershell
1powershell -c "(New-Object System.Net.WebClient).DownloadFile('<repo address>', 'install-logbeat.bat')" ; start -FilePath install-logbeat.bat "<token> task1ID_task2ID_task3ID..."

Description:

a) The task ID list follows the token parameter, and both of them are included within the same quote
b) Multiple tasks are separated by “,” without spaces
c) Only support transmission task IDs created under your account; you cannot add transmission task tasks created by others
d) Incorrect transmission task IDs do not affect normal operation of the agent

Update the agent

Linux environment

Update it via script by executing the bin/update.sh script in the agent root directory. The script can take a parameter [version], for example:

Shell
1sh bin/update.sh [latest/1.1.1]

If left empty, it will default to the latest version, meaning the agent will automatically update to the most recent version.

Windows environment

The agent must be uninstalled before reinstalling the latest agent

Uninstall the agent

Linux environment

Step I: Stop the agent process: service logbeatd stop; or execute /opt/logbeat/bin/stop.sh;

Step II: Remove the agent directory: rm -rf /opt/logbeat.

Windows environment

Step I: Stop the agent process: stop.bat;

Step II: Delete the agent directory: rm C:\Program Files\Baidu\Logbeat.

Windows system ZIP installation method

  1. Download ZIP package
  2. Unzip the package to a custom directory
  3. Modify configuration files logbeat.yml
YAML
1management:
2  enabled: true
3  token:
4  bls_server_address:
5  tasks: [ ]

Fill in the token for specifying agent installation location in the console at token;

image.png

Fill in the corresponding region’s endpoint at bls_server_address. The endpoints of each region are as follows:

region endpoint
Beijing https://bls.bj.baidubce.com:8185
Guangzhou https://bls.gz.baidubce.com:8185
Suzhou https://bls.su.baidubce.com:8185
Baoding https://bls.bd.baidubce.com:8185
Wuhan https://bls.fwh.baidubce.com:8185
Hong Kong https://bls.hkg.baidubce.com:8185
  1. Register service

    logbeat.exe -service-install

  2. Start services

    logbeat.exe -service-start

Previous
Logset Management
Next
Install Agent in K8s Environment