174
iPhone_iPad_Mac_手機_平板_蘋果apple
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-阿裏雲