Update promtail/rootfs/etc/promtail/default-scrape-config.yaml
This commit is contained in:
		@@ -1,27 +1,9 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
- job_name: journal
 | 
					job_name: home_assistant_logs
 | 
				
			||||||
  journal:
 | 
					    static_configs:
 | 
				
			||||||
    json: false
 | 
					      - targets:
 | 
				
			||||||
    max_age: 12h
 | 
					          - localhost  # Target for the logs, can be anything since it's just a label
 | 
				
			||||||
        labels:
 | 
					        labels:
 | 
				
			||||||
      job: systemd-journal
 | 
					          job: home_assistant  # Job label for your logs in Loki
 | 
				
			||||||
    path: "${JOURNAL_PATH}"
 | 
					          host: home_assistant  # Optional label for host, useful if running multiple Home Assistant instances
 | 
				
			||||||
  relabel_configs:
 | 
					          __path__: /config/home-assistant.log  # Path to Home Assistant log file
 | 
				
			||||||
    - source_labels:
 | 
					 | 
				
			||||||
        - __journal__systemd_unit
 | 
					 | 
				
			||||||
      target_label: unit
 | 
					 | 
				
			||||||
    - source_labels:
 | 
					 | 
				
			||||||
        - __journal__hostname
 | 
					 | 
				
			||||||
      target_label: nodename
 | 
					 | 
				
			||||||
    - source_labels:
 | 
					 | 
				
			||||||
        - __journal_syslog_identifier
 | 
					 | 
				
			||||||
      target_label: syslog_identifier
 | 
					 | 
				
			||||||
    - source_labels:
 | 
					 | 
				
			||||||
        - __journal_container_name
 | 
					 | 
				
			||||||
      target_label: container_name
 | 
					 | 
				
			||||||
  pipeline_stages:
 | 
					 | 
				
			||||||
    - match:
 | 
					 | 
				
			||||||
        selector: '{container_name=~"homeassistant|hassio_supervisor"}'
 | 
					 | 
				
			||||||
        stages:
 | 
					 | 
				
			||||||
          - multiline:
 | 
					 | 
				
			||||||
              firstline: '^\x{001b}'
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user