天天看點

Azure Log Analytics産品API文檔讀後感

OMS 主打的是一個雲上與雲下混合管理的概念,在國内很多混合雲的架構下喜歡将監控系統搭建在雲下(On-Premise),OMS目标是通過一個統一的Repository進行Local 與 Cloud統一。

Azure Log Analytics産品API文檔讀後感

除了以上兩種方案外,本身還提供管了解決平台(提供類似模闆快速部署方案)。

Azure Log Analytics産品API文檔讀後感

整體方案比較簡潔,采集資料,存儲,查詢+可視化。除了固定Data Source以外,還支援直接通過HTTP API進行資料寫入。

Azure Log Analytics産品API文檔讀後感

支援資料類型:

Windows Event Logs

Windows PerfCounter

Linux Perf counter

IIS Logs

Custom Fields

Clustom Logs

Syslog

參見:https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-sources

<a href="https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-data-collector-api">參考連結 </a>

Record:為KeyValue結構

Batch寫入,可以由多個Records組成,但Key數目必須一緻。

在寫入時的HTTP請求Header中有2個簽名外的Header字段:

time-generated-field : The name of a field in the data that contains the timestamp of the data item. If you specify a field then its contents are used for TimeGenerated. If this field isn’t specified, the default for TimeGenerated is the time that the message is ingested. The contents of the message field should follow the ISO 8601 format YYYY-MM-DDThh:mm:ssZ.

Log-Type:Specify the record type of the data that is being submitted. Currently, the log type supports only alpha characters. It does not support numerics or special characters.

第一個用指定日志中哪個字段為時間字段。Log-Type用以指定日志中每個字段的類型。例如在頭中number_s 代表key為number字段類型是String

Azure Log Analytics産品API文檔讀後感

限制:單個請求最大長度為30MB;每個Value最大為為32KB(超過會被截斷)

完整文法可以參見 https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-log-searches 。

SPL方式的文法,但功能比較簡單與 Splunk 差距較大。在查詢中帶了一個 Regex方式的查詢,算是特點。

包含FreeTier費用:

一天500MB,資料保留7天,超過500MB時服務到24點前無法使用

收費部分:

資料保留一個月,2.3$/GB = 15 RMB RMB,無寫入費用

超過一個月後存儲費用為0.1$/GB*Month = 0.66 RMB,存儲費用比較貴

在日本東/西有2個Region,在中國無服務。

繼續閱讀