Getting self created logfiles into loki

A custom developed application generates event log data.
sorted in a folder structure on disk like this:
c:\log\2022\12\21\

So a folder per day.
In this folder there are several logfiles that contain text info with timestamp and event or error definition

I would like to get this data in loki.
The server is up and running (checked with getting the logs from the different containers created). But i am kind of stuck in getting the custom files.

The promtail scrapeconfig looks like this:

scrape_configs:

  • job_name: docker

    use docker.sock to filter containers

    docker_sd_configs:
    • host: “unix:///var/run/docker.sock”
      refresh_interval: 15s
      filters:
      • name: label
        values: [“com.docker.compose.project=testloki”]

    use container name to create a loki label

    relabel_configs:
    • source_labels: [‘__meta_docker_container_name’]
      regex: ‘/(.*)’
      target_label: ‘container’
  • job_name: customlog
    static_configs:
    • targets:
      • 172.22.5.44
        labels:
        job: customlog
        path: C:\log\2022*log

What would be a good approach to get this data into loki?

thx,

Ben

Are these files located on a windows host?

Yes they are located on a windows host

For now forget docker and use promtail for windows pointing at

C:\log\2022\*.log or C:/log/2022/*log

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.