Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hostname using raw adapter #507

Open
radeth opened this issue May 12, 2021 · 0 comments
Open

Hostname using raw adapter #507

radeth opened this issue May 12, 2021 · 0 comments

Comments

@radeth
Copy link

radeth commented May 12, 2021

Hi
I'm trying to send logs on remote machine using raw adapter. On my log machine im using ELK (logstash). I have received container name in go template but i cant recevice properly hostname. A "host" field is ip number instead of hostname. I tried receive hostname in go-template with i used in raw_format variable like this:

  • "RAW_FORMAT={ "container": {{ toJSON .Container.Name }},"message": {{ toJSON .Data }},"hostname": {{ toJSON .Container.Config.Hostname }} }\n" but i receive "localhost"

here is my docker-compose.yaml file
version: "3"
networks:
logging:
services:
logspout:
image: gliderlabs/logspout:v3.2.12
command: 'raw+tcp://some.addres:5000'
environment:
- DEBUG=1
- "RAW_FORMAT={ "container": {{ toJSON .Container.Name }},"message": {{ toJSON .Data }},"hostname": {{ toJSON .Container.Config.Hostname }} }\n"
volumes:
- /etc/hostname:/etc/hostname
- /etc/hosts:/etc/hosts
- /var/run/docker.sock:/var/run/docker.sock
networks:
- logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant