# Getting logs from pods via filebeat

**URL:** <https://discuss.elastic.co/t/getting-logs-from-pods-via-filebeat/150274>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [September 28, 2018, 1:15am UTC](https://discuss.elastic.co/t/getting-logs-from-pods-via-filebeat/150274 "2018-09-28T01:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethrbunny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethrbunny/32/34603_2.png) [@ethrbunny](https://discuss.elastic.co/u/ethrbunny)\
**Post date:** [September 28, 2018, 1:15am UTC](https://discuss.elastic.co/t/getting-logs-from-pods-via-filebeat/150274/1 "2018-09-28T01:15:37Z")

</div>

Im hoping to get logs from my k8 pods (which are writing to stdout/stderr) via filebeat. At this point all Im seeing are what's being written to /var/log/messages on the k8 host.

Ive started the daemonset sample from [https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-kubernetes.html) (with the a change to write to logstash and not elasticsearch). I added these lines in hopes of getting some annotations:

```
  templates:
    - config:
        - type: docker
          containers.ids:
            - "${data.kubernetes.container.id}"

```

I have a test container that writes a simple datetime string every second.

In any event - Im missing some steps here or not understanding what's supposed to be happening.

- does this system require that filebeat is running on the k8 host?
- should I be seeing annotations? is the above sufficient to add them?

---

<div class="post-metadata">

**Author:** ![ethrbunny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ethrbunny/32/34603_2.png) [@ethrbunny](https://discuss.elastic.co/u/ethrbunny)\
**Post date:** [September 28, 2018, 2:19pm UTC](https://discuss.elastic.co/t/getting-logs-from-pods-via-filebeat/150274/2 "2018-09-28T14:19:59Z")

</div>

Answer: for whatever reason my system was setup to write to journald. As a result filebeat didn't have any logs to work with. I updated /etc/sysconfig/docker on the k8 hosts to write json logs and this fixed the problem.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 26, 2018, 2:20pm UTC](https://discuss.elastic.co/t/getting-logs-from-pods-via-filebeat/150274/3 "2018-10-26T14:20:02Z")

</div>

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