LogEntry.java 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.demo.seecanalysisbackend.model;
  2. import lombok.Data;
  3. import lombok.NoArgsConstructor;
  4. import lombok.AllArgsConstructor;
  5. import lombok.Builder;
  6. import org.springframework.data.annotation.Id;
  7. import org.springframework.data.elasticsearch.annotations.Document;
  8. import org.springframework.data.elasticsearch.annotations.Field;
  9. import org.springframework.data.elasticsearch.annotations.DateFormat;
  10. import org.springframework.data.elasticsearch.annotations.FieldType;
  11. import java.time.LocalDateTime;
  12. import java.util.Map;
  13. @Data
  14. @NoArgsConstructor
  15. @AllArgsConstructor
  16. @Builder
  17. @Document(indexName = "k8s-logs-*", createIndex = false)
  18. public class LogEntry {
  19. @Id
  20. private String id;
  21. @Field(type = FieldType.Date, name = "@timestamp", format = DateFormat.date_time)
  22. private LocalDateTime timestamp;
  23. @Field(type = FieldType.Text, name = "raw_message")
  24. private String rawMessage;
  25. @Field(type = FieldType.Text, name = "business_info")
  26. private String businessInfo;
  27. @Field(type = FieldType.Keyword, name = "service_name")
  28. private String serviceName;
  29. @Field(type = FieldType.Keyword, name = "process_name")
  30. private String thread;
  31. @Field(type = FieldType.Keyword, name = "log_level")
  32. private String level;
  33. @Field(type = FieldType.Keyword, name = "application")
  34. private String application;
  35. @Field(type = FieldType.Keyword, name = "method_location")
  36. private String className;
  37. @Field(type = FieldType.Keyword, name = "method_name")
  38. private String methodName;
  39. @Field(type = FieldType.Keyword, name = "trace_id")
  40. private String traceId;
  41. @Field(type = FieldType.Keyword, name = "span_id")
  42. private String spanId;
  43. @Field(type = FieldType.Keyword, name = "bizName")
  44. private String bizName;
  45. @Field(type = FieldType.Object, name = "context")
  46. private Map<String, Object> context;
  47. }