Closed hinder90 closed 7 years ago
Thanks for being interesting to use this plug-in. format
is used to define what things you want to send to sumo. As an example, you can try start with this (I assume you have logstash environment ready and know how to use json file to define output plug-ins):
output {
sumologic {
url => "https://endpoint1.collection.us2.sumologic.com/receiver/v1/http/XXXX"
format => "%{@timestamp} %{host} %{@json}"
}
stdout { }
}
As you can see, in format parameter, you can define a combination of fields in event (as %{@timestamp}
). and %{@json}
shows the whole event object in json format (e.g. the fields you can use)
If you are thinking about converting the event to output line with some complex processing, I may suggest you write your own filter plugin
Thank you for your reply.
Our logstash template is very basic, much like the format you have given in your example. The question remains how to best map these to the Sumo Logic metadata fields using HTTP headers as described in the SL documentation. Looking at your parameters I see that you support the specification of "extra headers" in hash form. I presume this is a mapping of the header name to a string? For instance, could I map "X-Sumo-Host" to "%{host}"?
Thanks again.
Theoretically it should work but I didn't test it as this way. Please file an issue if it's not work as expected. Thanks!
Presently, I am just ingesting the logs through the HTTP collector with no other options. The log data is in JSON and some perculiar things are happen which I am sure required configuration but the documentation is very scant and I am not sure how to actually configure it so that the Sumo Logic meta data is mapped correctly, each log event is treated as a its own log entry, etc... I need some examples/help/something!
Here is what is going on:
I tried making something like this but I don't even know if this is valid JSON:
Any help would be appreciated!