This topic describes how to query the source machine and number of logs in the Simple Log Service console.
If you use Logtail to collect logs, you can apply the Logtail configuration to machine group. For an IP address-based machine group, servers in the machine group are differentiated by using IP addresses. When you query logs, you can use the hostname and IP address to determine the source machine of logs.
Procedure
Simple Log Service collects hostname information from different logs and counts the number of logs.
Log on to the Simple Log Service console.
In the Projects section, click the project that you want to manage.
Click the Logstore that you want to manage.
In the search box, enter the following query statement and click Search & Analyze. The system returns the source machine of logs and the number of logs.
NoteBefore you can query logs in a Logstore, you must enable the index feature for the Logstore and turn on Enable Analytics for the
__tag__:__hostname__
field.* | select "__tag__:__hostname__" , count(1) as count group by "__tag__:__hostname__"