@extends('layouts.app') @section('title', 'Log 分析收集器') @section('content') @php $activeTab = request('tab', 'logs'); $kibanaUrl = config('services.elasticsearch.kibana_url'); if (!$kibanaUrl || str_contains($kibanaUrl, 'localhost')) { $kibanaUrl = request()->getScheme() . '://' . request()->getHost() . ':5601'; } @endphp
| 主機 | Log 類型 | 來源 | E | W | 行 | 狀態 | 收到時間 | |||
|---|---|---|---|---|---|---|---|---|---|---|
| {{-- 未讀紅點 --}} | @if(!$c->is_read) @endif | @if($c->host) @php $hKey = (string)$c->host_id; @endphp {{ $c->host->name }} @else {{ $c->hostname ?? $c->source_ip ?? '—' }} @endif | {{ $c->typeLabel() }} | @if($c->receive_method === 'rsyslog') rsyslog @elseif($c->receive_method === 'http_upload') API @else 手動 @endif | {{ $c->error_count > 0 ? $c->error_count : '·' }} | {{ $c->warning_count > 0 ? $c->warning_count : '·' }} | {{ $c->line_count ? number_format($c->line_count) : '—' }} | @php $sc = ['pending'=>'secondary','analyzing'=>'info','done'=>'success','error'=>'danger'][$c->status] ?? 'secondary'; $sl = ['pending'=>'待分析','analyzing'=>'分析中','done'=>'完成','error'=>'錯誤'][$c->status] ?? $c->status; @endphp @if($c->status === 'analyzing') {{ $sl }} @else {{ $sl }} @endif | {{ $c->created_at->format('m-d H:i') }} | |
| 尚無符合條件的 Log 記錄 @if(!request('host') && !request('log_type') && !request('severity')) , 或參考 設定說明 @endif | ||||||||||
| 規則 | 主機 | 符合內容 | 時間 |
|---|---|---|---|
| {{ $ev->rule->name ?? '—' }} | {{ $ev->host?->name ?? '—' }} |
{{ $ev->matched_line }}
|
{{ $ev->occurred_at?->format('m-d H:i') }} |
| 名稱 | 關鍵字 | 嚴重度 | 主機 | 通知 | 狀態 | |
|---|---|---|---|---|---|---|
| {{ $rule->name }} | {{ Str::limit($rule->pattern, 45) }} |
{{ ['any'=>'任意','error'=>'Error+','critical'=>'Critical+','warning'=>'Warning'][$rule->severity_filter] ?? $rule->severity_filter }} | {{ $rule->host?->name ?? '全部' }} | @if($rule->notify_email) @endif @if($rule->notify_webhook) @endif @if(!$rule->notify_email && !$rule->notify_webhook)—@endif | {{ $rule->enabled ? '啟用' : '停用' }} |
{{-- 編輯 --}}
{{-- 啟用 / 停用 --}}
{{-- 刪除 --}}
|
當 Log 分析後發現符合規則的內容,系統會立即送出通知。
/pattern/i 格式Failed password| 時間 | 等級 | 主機 | 類型 | 訊息 |
|---|---|---|---|---|
| 載入中… | ||||