阅读674 返回首页    go 微信


Logtail配置__公共资源说明_API-Reference_日志服务-阿里云

Logtail配置叫做Config,每个Project默认可以创建100个配置(Config),Config名在Project下具备唯一性。 用户可以通过Config指定日志收集的位置、方式和参数。

  • Config命名规范
    • 只能包括小写字母,数字,短横线(-)和下划线(_)
    • 必须以小写字母或者数字开头和结尾
    • 长度必须在2-128字节以内

完整资源示例:

{
    "configName": "testcategory1",
    “inputType”: ”file”,
    "inputDetail": {
        “logType”: “common_reg_log”,
        “logPath”: “/var/log/httpd/”,
        “filePattern”: “access.log”,
        “localStorage”: true,
        “timeFormat”: “%Y/%m/%d %H:%M:%S”,
        “logBeginRegex”: “.*”,
        “regex”: “(w+)(s+)”,
        “key” :[“key1”, “key2”],
        “filterKey”:[“key1”],
        “filterRegex”:[“regex1”],
        “topicFormat”: “none”
    },
    “outputType”: ”sls”,
    “outputDetail”: 
    {
        “logstoreName”: ”perfcounter”
    },
    “createTime": 1400123456,
    “lastModifyTime": 1400123456
}
属性名称 类型 是否必须 描述
configName string 日志配置名称, Project下唯一
inputType string 输入类型,默认为file
inputDetail json 见下表格说明
outputType string 输出类型,目前只支持LogService
outputDetail string 见下表格说明
createTime(output-only) integer 配置创建时间
lastModifyTime(output-only) integer 该资源服务端更新时间

inputDetail内容:

属性名称 类型 必须 描述
logType string 日志类型,现在只支持"common_reg_log"
logPath string 日志所在的父目录,例如 /var/logs/
filePattern string 日志文件的Pattern,例如 access*.log
localStorage boolean 是否打开本地缓存,在服务端之间链路断开情况下,本地可以缓存1GB日志
timeFormat string 日志时间格式, 如 "%Y/%m/%d %H:%M:%S"
logBeginRegex string 日志首行特征(正则表达式),由于匹配多行日志组成一条log的情况
regex string 日志对提取正则表达式
key array 日志提取后所生成Key
filterKey array 用于过滤日志所用到的key,只有key的值满足对应filterRegex列中设定的正则表达式日志才是符合要求的
filterRegex array 和每个filterKey对应的正正则表达式, filterRegex的长度和filterKey的长度必须相同
topicFormat string 用于将日志文件路径的某部分作为topic,如/var/log/(.*).log,默认为none,表示topic为空。
preserve boolean true代表监控目录永不超时,false代表监控目录30分钟超时,默认值为true
preserveDepth integer 当设置preserve为false时,指定监控不超时目录的深度,最大深度支持3

outputDetail内容:

属性名称 类型 必须 描述
logstoreName string 对应logstore名字

最后更新:2016-11-24 11:23:47

  上一篇:go 分区__公共资源说明_API-Reference_日志服务-阿里云
  下一篇:go Logtail机器组__公共资源说明_API-Reference_日志服务-阿里云