fix: never use parse time as event or collection time
Dump data is always historical. Parsers stamped undated events with time.Now() (Inspur component.log memory/fan status, IDL/H3C SEL with unparsable time, NVIDIA summary/bug-report, generic, XigmaNAS, Unraid, Redfish replay warnings), so an August dump opened in September showed DIMM warnings dated the day of analysis. - Events without a source time keep a zero timestamp. - Yearless syslog timestamps take the year from the collection time via parser.ParseYearlessInDefaultArchiveLocation; zero when unknown. - Archive/uploaded-snapshot collected_at is no longer defaulted to now; only live API collection uses the current time. ADL-070. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8794e0adec
commit
f2ad0aca96
19 files changed
+95
-85
No files matched your search
-4
@@ -3,7 +3,6 @@ package generic
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
@@ -96,7 +95,6 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
|
||||
// Create a single event with file info
|
||||
result.Events = append(result.Events, models.Event{
|
||||
Timestamp: time.Now(),
|
||||
Source: "File",
|
||||
EventType: "Text File",
|
||||
Description: "Generic text file loaded",
|
||||
@@ -122,7 +120,6 @@ func parseNvidiaBugReport(content string, result *models.AnalysisResult) {
|
||||
if strings.Contains(line, "NVRM version:") || strings.Contains(line, "nvidia-smi") {
|
||||
if i+5 < len(lines) {
|
||||
result.Events = append(result.Events, models.Event{
|
||||
Timestamp: time.Now(),
|
||||
Source: "NVIDIA Driver",
|
||||
EventType: "Driver Info",
|
||||
Description: "NVIDIA driver information found",
|
||||
@@ -135,7 +132,6 @@ func parseNvidiaBugReport(content string, result *models.AnalysisResult) {
|
||||
// Find GPU devices
|
||||
if strings.Contains(line, "/proc/driver/nvidia/gpus/") && strings.Contains(line, "***") {
|
||||
result.Events = append(result.Events, models.Event{
|
||||
Timestamp: time.Now(),
|
||||
Source: "GPU",
|
||||
EventType: "GPU Device",
|
||||
Description: "GPU device detected",
|
||||
|
||||
Reference in new issue
Block a user