Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

How to define a variable to distinguish the source logfile #1975

Open
ruiaylin opened this issue Aug 3, 2016 · 1 comment
Open

How to define a variable to distinguish the source logfile #1975

ruiaylin opened this issue Aug 3, 2016 · 1 comment

Comments

@ruiaylin
Copy link

ruiaylin commented Aug 3, 2016

like this :

I have two nginx instance running on port 80 , 81 .

i do not know how to config this to support for multi instance .

@michaelgibson
Copy link
Contributor

I'm not 100% sure what you are asking, may need some clarification.

I'm assuming you are asking how to collect from multiple log files and how to differentiate between them once in Heka?
Assuming you have some way of uniquely identifying each of your log streams, the logstreamer input has a config field "differentiator"
When defined it will set the "Logger" header in the message.

[accesslogs]
type = "LogstreamerInput"
log_directory = "/var/log/nginx"
file_match = '(?P<Port>[^/]+)-access\.log'
differentiator = ["nginx.", "Port", ".access"]

[LogOutput]
message_matcher = "Logger == '<Port Value>'"
encoder = "RstEncoder"

[RstEncoder]

This allows you to distinguish between different incoming log streams.

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

No branches or pull requests

2 participants