174
阿里云
Logtail日期格式__logtail(Agent)_用户指南_日志服务-阿里云
正如日志服务核心概念中所描述,每条日志服务日志都必须包括该日志发生的时间戳信息。Logtail接入服务在采集用户日志文件中的日志数据,必须提取该条日志中时间戳字符串并把它解析为时间戳。因此,Logtail需要用户指定其日志的时间戳格式帮助解析。
Linux平台下的Logtail支持strftime函数提供的所有时间格式。 只需要用户的日志时间戳字符串能够被该函数定义的日志格式所表达,即可以被Logtail解析并使用。
现实环境中的日志时间戳字符串格式非常多样化,为方便用户配置,Logtail支持的常见日志时间格式如下:
支持格式 | 格式意义 | 示例 |
---|---|---|
%a | locale’s abbreviated weekday name | 例如:Fri |
%A | locale’s full weekday name | 例如:Friday |
%b | locale’s abbreviated month name | 例如:Jan |
%B | locale’s full month name | 例如:January |
%d | day of the month as a decimal number [1,31] | 例如:7, 31 |
%h | same as %b | 例如:Jan |
%H | hour (24-hour clock) as a decimal number | 例如:22 |
%I | hour (12-hour clock) as a decimal number | 例如:11 |
%m | month as a decimal number | 例如:08 |
%M | minute as a decimal number [00,59] | 例如:59 |
%n | newline character | 换行符 |
%p | locale’s equivalent of either a.m. or p.m | 例如:AM/PM |
%r | time in a.m. and p.m. notation (%I:%M:%S %p) | 例如:11:59:59 AM |
%R | time in 24 hour notation (%H:%M) | 例如:23:59 |
%S | second as a decimal number[00,59] | 例如:59 |
%t | tab character | TAB符 |
%y | year without century as a decimal number [00,99] | 例如:04,98 |
%Y | year with century as a decimal number | 例如:2004,1998 |
%z | timezone name or abbreviation, or by no bytes if no timezone information exists | 例如:-07:00, +0800 |
%C | century number as a decimal number [00-99] | 例如:16 |
%e | the day of the month as a decimal number [1,31]; a single digit is preceded by a space{color} | |
%j | day of the year as a decimal number [001,366] | 例如:365 |
%u | weekday as a decimal number [1,7], with 1 representing Monday | 例如:2 |
%U | week number of the year (Sunday as the first day of the week) as a decimal number [00,53] | 例如:23 |
%V | week number of the year (Monday as the first day of the week) as a decimal number [01,53] | 例如:24 |
%w | weekday as a decimal number [0,6], with 0 representing Sunday{ | 例如:5 |
%W | week number of the year (Monday as the first day of the week) as a decimal number [00,53] | 例如:23 |
%c | locale’s appropriate date and time representation | 需要指定长日期、短日期等更多信息,可以考虑用上面支持的格式更精确表达 |
%x | locale’s appropriate date representation | 需要指定长日期、短日期等更多信息,可以考虑用上面支持的格式更精确表达 |
%X | locale’s appropriate time representation | 需要指定长日期、短日期等更多信息,可以考虑用上面支持的格式更精确表达 |
%s | unix 时间戳 | 例如:1476187251 |
最后更新:2016-10-11 20:01:33
上一篇:
安装Logtail__logtail(Agent)_用户指南_日志服务-阿里云
下一篇:
Logtail自定义机器标识管理__logtail(Agent)_用户指南_日志服务-阿里云
ShareGroupType__数据类型_API 参考_云服务器 ECS-阿里云
取消自动快照策略__快照相关接口_API 参考_云服务器 ECS-阿里云
阿里云发布数十款新产品,弹性灵活不止于计费
获取主题列表__主题使用帮助_控制台使用帮助_消息服务-阿里云
使用表格存储的 API__开发指南_表格存储-阿里云
OSS 403错误及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
域名解析生效原理及时间__解析生效_产品使用问题_云解析-阿里云
使用自定义镜像创建实例__创建实例_实例_用户指南_云服务器 ECS-阿里云
SSH 登录时出现如下错误:login: Module is unknown__远程登录 (SSH)_Linux操作运维问题_云服务器 ECS-阿里云
不使用主账号__权限管理_最佳实践_对象存储 OSS-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云