💽
Azure Log Analytics の 検索 (SEARCH)、復元(RESTORE)の仕様
はじめに
Log Analytics の 検索 (SEARCH)、復元 (RESTORE) について、公式ドキュメントが非常にわかりづらいので、自分なりの解釈をまとめました。間違っていたらコメントください。
検索 (SEARCH)
- Sentinel では WebUI で実行可能だが、Table | where * has "xxx" の形で固定される
- Log Analytics の CLI では where や project などの KQL が使用可能
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/search-jobs#kql-query-limitations - _SEARCH が付いた Analytics テーブルが新規に作成
- TimeGenerated は SEARCH した時刻になり、元ログの時刻は _OriginalTimeGenerated に入る、Type なども同様
- 保管期間は Log Analytics ワークスペースの保有期間が適用
- 保管期間は作成後に個別に設定可能
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/search-jobs#what-does-a-search-job-do - SEARCH でスキャンしたデータ量に対して課金+作成されたテーブルの取り込みデータ量に対して課金
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/search-jobs#pricing-model
復元 (RESTORE)
- ソーステーブル、開始時刻、終了時刻を指定してリストア
- デフォルトだと _RST が付いた新たな Analytics テーブルが作成
- テーブルは明示的に削除しない限り消えない、中身はソースデータが消えれば消える(Achive の保存日数)
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/restore#what-does-restore-do
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/restore#dismiss-restored-data - SEARCH との使い分け:条件指定せず、期間指定して一括でログを戻したいケースに使用
- TimeGenerated は元ログのまま復元される(Type は異なる、他の差分は未チェック)
- 復元したデータ量とそのデータが使用可能であった日数で課金される
- per day とあるので、リストアで保持したテーブルは Log Analytics のデータ保持料金ではなく、毎日データ復元の費用がかかる(と思われる)
→ 確実に削除しないといつの間にか、かなりのコストが発生していた、というリスクあり?
https://docs.microsoft.com/ja-jp/azure/azure-monitor/logs/restore#pricing-model
参考
Discussion