Create a General Collection Policy
<p class="shortdesc">This article describes how to create a general collection policy for a host group. </p>
<section class="section prereq" id="Create_Strategy__prereq_ifh_zpz_wmb"><div class="tasklabel"><h2 class="doc-tairway">Before you begin</h2></div>
<p class="p">You have successfully created a host group. For more information, see <a class="xref" href="/ssr/help/middleware/LogCloud/User_Guide.Collect.Agent_Group.Create_Agent_Group" target="_blank">Create a Host Group</a>.</p>
</section>
<section class="section context"><div class="tasklabel"><h2 class="doc-tairway">About this task</h2></div>
<p class="p">To collect logs from cloud hosts in a host group, make sure the following
prerequisites are met:</p>
<ul class="ul" id="Create_Strategy__ul_cmv_4jl_wnb">
<li class="li"><span class="ph uicontrol">Log collection clients</span>—Ping An Cloud automatically installs a log
collection client on each cloud host in the host group.<div class="note important note_important"><span class="note__title">Important:</span> Currently, only hosts running Linux, Windows, and Unix operating systems
support installing log collection clients.</div></li>
<li class="li"><span class="ph uicontrol">Collection policies</span>—Configure collection policies for the host group in
the console.</li>
</ul>
</section>
<section><div class="tasklabel"><h2 class="doc-tairway">Procedure</h2></div><ol class="ol steps"><li class="li step stepexpand">
<span class="ph cmd"> Log in to the<a class="xref" href="/console/logcloud/indexed/list" target="_blank">Log Service Console</a>。</span>
</li><li class="li step stepexpand">
<span class="ph cmd">In the left navigation pane, click <span class="ph uicontrol">Project Management</span>.</span>
</li><li class="li step stepexpand">
<span class="ph cmd">On the <span class="ph uicontrol">Project Management</span> page, select the target region.</span>
</li><li class="li step stepexpand">
<span class="ph cmd">Click the target project name.</span>
</li><li class="li step stepexpand">
<span class="ph cmd">Click the <span class="ph uicontrol">AGENT CONFIG</span> tab.</span>
</li><li class="li step stepexpand">
<span class="ph cmd">In the upper-right corner of the page, click <span class="ph uicontrol">Create</span><span class="ph uicontrol">Config</span>.</span>
</li><li class="li step stepexpand">
<span class="ph cmd">On the <span class="ph uicontrol">Create Config</span> page, create a general log collection policy as
described in the following table:</span>
<div class="itemgroup info">
<table class="table" id="Create_Strategy__table_yhf_hqz_wmb"><caption></caption><colgroup><col><col></colgroup><thead class="thead">
<tr class="row">
<th class="entry" id="Create_Strategy__table_yhf_hqz_wmb__entry__1">Configuration item</th>
<th class="entry" id="Create_Strategy__table_yhf_hqz_wmb__entry__2">Description</th>
</tr>
</thead><tbody class="tbody">
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Data Type</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Select log type <span class="ph uicontrol">General</span>.</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Name</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Configure the name of the general collection policy.</p>
<ul class="ul" id="Create_Strategy__ul_bpp_fkl_wnb">
<li class="li">Supported characters are Chinese characters,
uppercase and lowercase letters, digits, and special
characters including underscores (_), hyphens (-),
and at signs (@).</li>
<li class="li">The length of the policy name is 1 to 45
characters.</li>
</ul>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Log Path </p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Configure the absolute path of the logs to be collected
on the cloud hosts.</p>
<div class="note note note_note"><span class="note__title">Note:</span>
<ul class="ul" id="Create_Strategy__ul_wmy_hkl_wnb">
<li class="li">The path must be specific to the file.</li>
<li class="li">Subdirectories are not scanned by default.</li>
<li class="li">Separate multiple paths with commas (,).</li>
</ul>
</div>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Log Encoding</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Select the encoding format (UTF-8 or GBK) if the logs to
be collected contain Chinese characters.</p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Archive Or Not</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Select whether to archive the collected log files to the
Ping An Cloud storage devices.</p>
<ul class="ul" id="Create_Strategy__ul_ulq_kkl_wnb">
<li class="li"><span class="ph uicontrol">Yes</span>—Logs can be saved on Ping An Cloud for
one year. Ping An Cloud automatically deletes these
logs after one year is reached. To save logs on the
storage devices of Ping An Cloud for a longer time,
submit a <a class="xref" href="/console/workorder/create" target="_blank">Ticket</a>. </li>
<li class="li"><span class="ph uicontrol">No</span>—Log files are not archived. The system
will automatically delete the log data when its
retention period expires.</li>
</ul>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Use For Groups</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Select the host group to which the collection policy is
applied. </p>
</td>
</tr>
<tr class="row">
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 ">
<p class="p">Add Field</p>
</td>
<td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 ">
<p class="p">Add customized fields to the collected logs.</p>
</td>
</tr>
</tbody></table>
</div>
</li><li class="li step stepexpand">
<span class="ph cmd">Click <span class="ph uicontrol">Confirm</span>.</span>
</li></ol></section>
<section class="section result" id="Create_Strategy__result_zpt_pqz_wmb"><div class="tasklabel"><h2 class="doc-tairway">Results</h2></div>
<p class="p">The new general collection policy is displayed on the <span class="ph uicontrol">AGENT CONFIG</span> tab.</p>
<img class="image" id="Create_Strategy__image_qxg_tqz_wmb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20210106133702-15edacb799fa.png" width="830">
</section>
Did the above content solve your problem?
Yes
No
Submitted successfully! Thank you for your feedback, we will try our best to do better and better!