Skip to main content

How to Send Virtual Machine Logs to DT Observability

Now, we will display the logs on the explorer using the Observability service.

Firstly, we install fluent-bit on our machine using the command below.

curl https://raw.githubusercontent.com/fluent/fluent-bit/master/install.sh | sh

After installing Fluent-bit, an alias and agent user must be created via the Observability service.

Creating Alias and Agent User

Create an Alias

1- Go to the "Aliases" page.

2- Click "Create an Alias" button.

3- On the "Create an Alias" page, enter the name "dtcloudxalias".

4- Specify Replica Count, Shard Count and Retention Day option.

5- Click "Create an Alias" button.

Create an Agent User

1- Go to the "Agent User" page.

2- Click "Create Agent User" button.

3- Specify the Agent User Name as "dtcloudxagent"

4- Click Choose an Alias button and select "dtcloudxalias" from the list.

5- Click "Create an Agent User" button.

Upload the Logs

After creating the agent user and alias, we logged into the Ubuntu machine again.

Use the following command to access the file containing fluent-bit.

cd /etc/fluent-bit 

Next, delete the contents of the fluent-bit conf file.

sudo rm -rf fluent-bit.conf 

After that go into fluent-bit conf file.

sudo nano fluent-bit.conf

Copy the following configuration settings into the conf file.

[INPUT]
Name cpu
Tag my_cpu

[OUTPUT]
Name opensearch
Match *
Host cluster-3.opensearch.dtclouddev.io
Port 443
Path /backend/_bulk
HTTP_User <9fcbc62440_dtcloudxagent>
HTTP_Passwd <8mDpHwfia&^Re>
Index <85d167f5fe_dtcloudalias>
Type _doc
Suppress_Type_Name On
tls On
tls.verify Off
note

You need to fill in the following inputs according to your own information. You can find this information in the agent user information panel.

  • HTTP_User: Agent user name
  • HTTP_Passwd: Agent user password
  • Index: Alias Name

Next, restart the system so that the agent user is recognized in the system.

sudo systemctl restart fluent-bit.service 

After that, check that the system is working.

sudo systemctl status fluent-bit.service 

Lastly, check the logs in explorer page.

info

For more information, visit the Example page.