package com.demo.seecanalysisbackend.model; import lombok.Data; import lombok.NoArgsConstructor; import lombok.AllArgsConstructor; import lombok.Builder; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Field; import org.springframework.data.elasticsearch.annotations.DateFormat; import org.springframework.data.elasticsearch.annotations.FieldType; import java.time.LocalDateTime; import java.util.Map; @Data @NoArgsConstructor @AllArgsConstructor @Builder @Document(indexName = "k8s-logs-*", createIndex = false) public class LogEntry { @Id private String id; @Field(type = FieldType.Date, name = "@timestamp", format = DateFormat.date_time) private LocalDateTime timestamp; @Field(type = FieldType.Text, name = "raw_message") private String rawMessage; @Field(type = FieldType.Text, name = "business_info") private String businessInfo; @Field(type = FieldType.Keyword, name = "service_name") private String serviceName; @Field(type = FieldType.Keyword, name = "process_name") private String thread; @Field(type = FieldType.Keyword, name = "log_level") private String level; @Field(type = FieldType.Keyword, name = "application") private String application; @Field(type = FieldType.Keyword, name = "method_location") private String className; @Field(type = FieldType.Keyword, name = "method_name") private String methodName; @Field(type = FieldType.Keyword, name = "trace_id") private String traceId; @Field(type = FieldType.Keyword, name = "span_id") private String spanId; @Field(type = FieldType.Keyword, name = "bizName") private String bizName; @Field(type = FieldType.Object, name = "context") private Map context; }