Hrm. File names are tricky, b/c the LogstreamerInput usually thinks in terms of log *streams*, not files, so the name of the file that a particular record came from isn't readily available.

I suspect that you don't actually need the file, though, but that some unique identifier for your stream is actually enough. If that's the case, you should check out the `Logger` value on your generated messages. That will contain your differentiator value, if you have a differentiator specified. If not, it should at least be unique for each LogstreamerInput in use.

If that's not good enough, you might have to do something yourself in the decoding layer. Hopefully Logger will suffice, though.

-r


On 02/08/2016 11:33 AM, Eli Flesher wrote:
Hello Everyone,

We’re exploring using Heka internally as a daemon to push up
periodically written files and submit changes to an API for consumption.

As part of this project, I’ve written an Encoder that formats messages
from several LogStreamerInputs into our message format before going to
an Output plugin that submits the messages.

I’ve run into one problem. I need to know the file name being monitored
in order to determine parts of the message body. Looking at the
LogStreamerInput code, I can’t see a way that this is exposed, but I’m
also very new to Go.

Can anyone guide me on how I might accomplish this?


Eli
--
—
*Elijah Flesher*  | *Lyft* <http://lyft.me/>  | /Software Engineer/
206.661.4697  |  @eliflesher


_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka

Reply via email to