Oh, sheesh. I'm sorry. I've been slowly working my way through the mailing list
backlog, and responded to your earlier thread before getting far enough to see
this message.
Anyway, no, unfortunately the hostname is not automatically available to the
sandbox right now. As a workaround, you can pass it in from the configuration.
If you have a sandbox decoder configured like so:
[my_decoder]
type = "SandboxDecoder"
filename = "/path/to/my_decoder.lua"
Then you can add a config sub-section like this:
[my_decoder]
type = "SandboxDecoder"
filename = "/path/to/my_decoder.lua"
[my_decoder.config]
hostname = "hostname.example.com"
Then you can get the value from the config by using `read_config("hostname")`
in your Lua code. You'll want to do this outside of the `process_message` function, so it
only happens at initialization time and not for every message.
Hope this is useful, sorry again for not reading ahead and saving us both some
effort and confusion.
-r
On 04/14/2015 06:51 AM, Cristian Falcas wrote:
Hello,
It looks like the hostname is not set when using UdpInput with net =
"unixgram".
Is there any possibility to have access to the machine's hostname? I'm
trying to write a sandbox decoder and I would like to set the hostname
also for the messages.
Best regards,
Cristian Falcas
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka
_______________________________________________
Heka mailing list
[email protected]
https://mail.mozilla.org/listinfo/heka