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.
サーバー
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.
次の例は、サーバーのサンプル構成です。
{
"ip" : "testip1",
"machine-uniqueid" : "testuuid1",
"userdefined-id" : "testuserdefinedid1",
"lastHeartbeatTime":1397781420
}サーバーの属性を次の表に示します。
項目 | 種類 | 説明 |
ip | String | The IP address that is associated with the hostname of the server. |
uuid | String | マシンによってマークされた一意の主キー。 主キーはLogtailによってアップロードされます。 |
userdefined-id | String | Logtailによってアップロードされたサーバーのユーザー定義識別子。 |
lastHeartbeatTime | Integer | The last heartbeat time of the server. この値は、エポック時刻から経過した秒数を表すUNIXタイムスタンプです。 |
マシングループ
Log Serviceコンソールでマシングループを作成し、マシングループにサーバーを追加できます。 次に、ログ収集用のLogtail設定を作成し、その設定をマシングループに適用できます。 これにより、設定に基づいてサーバーからログを収集できます。 マシングループを特定するには、次のいずれかの方法を使用します。
IPアドレス: すべてのサーバーのIPアドレスをマシングループの識別子に追加します。 グループの各サーバーは、それぞれに固有の IP アドレスで特定することができます。
ユーザー定義識別子: マシングループの識別子をカスタマイズし、マシングループ内のサーバーに同じ識別子を使用します。
マシングループの名前は、次の要件を満たす必要があります。
名前には、小文字、数字、ハイフン (-) 、およびアンダースコア (_) を使用できます。
名前の最初と最後は、小文字または数字にする必要があります。
名前は3〜128バイトである必要があります。
例:
{ "groupName" : "testgroup",
"groupType" : "",
"groupAttribute" : {
"externalName" : "testgroup",
"groupTopic": "testgrouptopic"
},
"machineIdentifyType": "ip",
"machineList" : [
"ip1",
"ip2"
...
],
"createTime": 1431705075,
"lastModifyTime" : 1431705075
}マシングループの属性を次の表に示します。
属性 | データ型 | 必須/任意 | 説明 |
groupName | String | 必須 | マシングループの名前。 名前はプロジェクト内で一意である必要があります。 |
groupType | String | 任意 | The type of the machine group. デフォルト値:null |
machineIdentifyType | String | 必須 | The type of the machine identifier. Valid values: IP and userdefined-id. |
groupAttribute | オブジェクト | 〇 | マシングループの属性。 デフォルト値:null |
machineList | 配列 | 〇 | マシン識別子のリスト。IPアドレスまたはユーザー定義の識別子にすることができます。 |
createTime | Int | いいえ | マシングループが作成された時刻。 |
lastModifyTime | Int | いいえ | マシングループが更新された時刻。 |
次の表に、groupAttributeオブジェクトの属性を示します。
属性 | データ型 | 必須/任意 | 説明 |
groupTopic | String | 任意 | The topic of the machine group. デフォルト値:null |
externalName | String | 任意 | マシングループが依存する外部管理識別子。 デフォルト値:null |