Score:0

Not able to get Labels from Promtail static_configs

gw flag

I'm using the latest promtail and loki and trying to use your static_configs example.. but I'm not getting the labels pushed to Loki.. all I see below

Discovered labels
__address
__path
job

I do not see labels of facility and hostname am I doing something wrong ?

here is my promtail

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: C:\loki\tmp\promtail\positions.yaml

clients:
  - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: rfc5424
  pipeline_stages:
    # Assuming the logs are in RFC5424 format, use the regex to extract the hostname and facility
    - regex:
        expression: '.*?(\d+)\s\d+-\d+-\d+T\d+:\d+:\d+.\d+\S+\s+(\S+)\s+.*'
        output:
          source_labels: [facility, hostname]
    # Map the extracted facility number to a facility name
    - labels:
        facility: "${1}"
        hostname: "${2}"
  static_configs:
  - targets:
      - localhost
    labels:
      job: rfc5424
      __path__: C:\logs\rfc5424\*log

My Log format is

1 2003-10-11T22:14:15.003Z mymachine.example.com evntslog - ID47 [exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"] BOMAn application event log entry...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.