创建通用采集策略

<p class="shortdesc">本文主要介绍如何为主机组创建通用的采集策略。</p> <section class="section prereq" id="Create_Strategy__prereq_ifh_zpz_wmb"><div class="tasklabel"><h2 class="doc-tairway">前提条件</h2></div> <p class="p">您已成功创建主机组,可参考<a class="xref" href="/ssr/help/middleware/LogCloud/User_Guide.Collect.Agent_Group.Create_Agent_Group" target="_blank">创建主机组</a>。</p> </section> <section class="section context"><div class="tasklabel"><h2 class="doc-tairway">背景信息</h2></div> <p class="p">使用平安云日志服务采集日志:</p> <ul class="ul" id="Create_Strategy__ul_pxh_wpz_wmb"> <li class="li">安装日志采集客户端:平安云会自动为您需要采集日志的主机组安装日志采集客户端。<div class="note note note_note"><span class="note__title">说明:</span> 目前支持针对Linux 、Windows和Unix系统安装采集客户端。</div></li> <li class="li">配置采集策略:您可以通过控制台给相应的主机组创建日志采集策略。</li> </ul> </section> <section><div class="tasklabel"><h2 class="doc-tairway">操作步骤</h2></div><ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd"> 登录<a class="xref" href="/console/logcloud/indexed/list" target="_blank">日志服务管理控制台</a>。</span> </li><li class="li step stepexpand"> <span class="ph cmd">单击左侧导航栏<span class="ph uicontrol">项目管理</span>,进入<span class="keyword wintitle">项目列表</span>页面。</span> </li><li class="li step stepexpand"> <span class="ph cmd">选择目标地域,单击目标项目名称。</span> </li><li class="li step stepexpand"> <span class="ph cmd">单击<span class="ph uicontrol">AGENT配置</span>页签。</span> </li><li class="li step stepexpand"> <span class="ph cmd">单击页面右上角<span class="ph uicontrol">创建配置</span>,进入<span class="keyword wintitle">创建配置</span>页面。</span> </li><li class="li step stepexpand"> <span class="ph cmd">根据以下信息,创建通用日志采集策略:</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">配置项</th> <th class="entry" id="Create_Strategy__table_yhf_hqz_wmb__entry__2">说明</th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">数据类型</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">配置采集的日志类型,支持:</p> <ul class="ul" id="Create_Strategy__ul_zhf_hqz_wmb"> <li class="li">Nginx</li> <li class="li">通用</li> </ul> <p class="p">此处选择通用。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">名称</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">配置通用采集策略的名称。</p> <ul class="ul" id="Create_Strategy__ul_a3f_hqz_wmb"> <li class="li">支持汉字、英文大小写字母、数字、特殊字符“_”“-”“@”。</li> <li class="li">长度在1~45个字符之间。</li> </ul> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">日志路径</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">配置待采集日志的云主机上的绝对路径。</p> <div class="note note note_note"><span class="note__title">说明:</span> <ul class="ul" id="Create_Strategy__ul_c3f_hqz_wmb"> <li class="li">目录必须具体到文件。</li> <li class="li">默认不扫描子目录。</li> <li class="li">多个路径使用英文逗号隔开。</li> </ul> </div> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">日志编码</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">待采集日志的内容中包含中文时,采用的编码格式,支持:</p> <ul class="ul" id="Create_Strategy__ul_d3f_hqz_wmb"> <li class="li">UTF-8</li> <li class="li">GBK</li> </ul> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">是否归档</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">是否需要将采集到的日志文件归档在平安云提供的存储设备上。</p> <ul class="ul" id="Create_Strategy__ul_g2k_lqz_wmb"> <li class="li">是:归档,日志可在平安云上保存一年。<ul class="ul" id="Create_Strategy__ol_uyw_lqz_wmb"> <li class="li"> 系统将自动删除超过一年的日志数据。</li> <li class="li"> 若您需要在平安云的存储设备中保存更长时间,可提交<a class="xref" href="/console/workorder/create" target="_blank">工单</a>申请。</li> </ul></li> <li class="li">否:不归档。系统将自动删除超过索引设置保存时间的日志数据。</li> </ul> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">应用到主机组</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">选择需要应用此采集策略的主机组。</p> </td> </tr> <tr class="row"> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__1 "> <p class="p">添加字段</p> </td> <td class="entry" headers="Create_Strategy__table_yhf_hqz_wmb__entry__2 "> <p class="p">可在采集到的日志中根据需求增加自定义字段。</p> </td> </tr> </tbody></table> </div> </li><li class="li step stepexpand"> <span class="ph cmd">单击<span class="ph uicontrol">确定</span>。</span> </li></ol></section> <section class="section result" id="Create_Strategy__result_zpt_pqz_wmb"><div class="tasklabel"><h2 class="doc-tairway">执行结果</h2></div> <p class="p">在<span class="ph uicontrol">AGENT配置</span>页签,可以看到刚刚创建的通用采集策略。 </p> <img class="image" id="Create_Strategy__image_qxg_tqz_wmb" src="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/20210106133702-138634739197.png" width="830"> </section>
以上内容是否解决了您的问题?
请补全提交信息!
咨询·建议

电话咨询 - 7x24 小时

400-151-8800

邮件咨询

cloud@pingan.com

在线客服

7x24 小时,急速解答

工单支持

解决云产品相关技术问题