All Products
Search
Document Center

Simple Log Service:Machine groups

Last Updated:Oct 26, 2023

This topic describes the servers and machine groups that are associated with log collection. It also provides an example of server and machine group configurations.

Servers

After a server is installed with Logtail and then restarted, the server is automatically associated with the user that is specified in the Logtail configurations.

The following example is sample configurations for a server:
{
    "ip" : "testip1",
    "machine-uniqueid" : "testuuid1",
    "userdefined-id" : "testuserdefinedid1",
    "lastHeartbeatTime":1397781420
 }
The following table lists attributes of a server.
ParameterTypeDescription
ipStringThe IP address that is associated with the hostname of the server.
uuidStringThe unique primary key marked by the machine. The primary key is uploaded by Logtail.
userdefined-idStringThe user-defined identifier of the server that is uploaded by Logtail.
lastHeartbeatTimeIntegerThe last heartbeat time of the server. The value is a UNIX timestamp representing the number of seconds that have elapsed since the epoch time.

Machine groups

You can create a machine group and add servers to the machine group in the Log Service console. Then you can create Logtail configurations for log collection and apply the configurations to the machine group. This way, you can collect logs from the servers based on the configurations. To identify a machine group, you can use one of the following methods:
  • IP address: Add the IP addresses of all servers to the identifier of a machine group. Each server in the group can be identified by using its unique IP address.
  • User-defined identifier: Customize an identifier for a machine group and use the same identifier for servers in the machine group.
The name of a machine group must meet the following requirements:
  • The name can contain lowercase letters, digits, hyphens (-), and underscores (_).
  • The name must start and end with a lowercase letter or digit.
  • The name must be 3 to 128 bytes in length.

Example

{    "groupName" : "testgroup",
    "groupType" : "",
    "groupAttribute" : {
        "externalName" : "testgroup",
        "groupTopic": "testgrouptopic"
    },
    "machineIdentifyType": "ip",
    "machineList" : [
        "ip1",
        "ip2"
        ...
    ],
    "createTime": 1431705075,
    "lastModifyTime" : 1431705075
}
The following table describes the attributes of a machine group.
AttributeTypeRequiredDescription
groupNameStringYesThe name of the machine group. The name must be unique in a project.
groupTypeStringNoThe type of the machine group. Default value: null.
machineIdentifyTypeStringYesThe type of the machine identifier. Valid values: IP and userdefined-id.
groupAttributeObjectYesThe attribute of the machine group. Default value: null.
machineListArrayYesThe list of machine identifiers, which can be IP addresses or user-defined identifiers.
createTimeIntNoThe time when the machine group was created.
lastModifyTimeIntNoThe time when the machine group was updated.
The following table describes the attributes in the groupAttribute object.
AttributeTypeRequiredDescription
groupTopicStringNoThe topic of the machine group. Default value: null.
externalNameStringNoThe external management identifier on which the machine group depends. Default value: null.