nginx-fluentd-module icon indicating copy to clipboard operation
nginx-fluentd-module copied to clipboard

Added possibility to ignore JSON format and added backslashes escape for JSON

Open kayrus opened this issue 11 years ago • 3 comments

  1. Now it is possible to send logs in plain text format when nginx fluentd_tag is empty: (fluentd_tag '';)
  2. curl 'localhost/\t' produced broken JSON format and td-agent was not able to parse JSON format. I've added possibility to escape backslashes if necessary.

First of all I've tried to implement this feature without additional escaped_line variable, but I was not able to determine how many slashes are there to alloc the extra memory. So I had to create new variable.

kayrus avatar Nov 14 '14 16:11 kayrus

Thanks for the request. There is a default tag "nginx", you can see line 191. I will check the backslash escape.

semihalev avatar Nov 14 '14 20:11 semihalev

There is default 'nginx' tag if you don't set the fluentd_tag. But if you will set it to empty string - all logs will be sent if plain text.

kayrus avatar Nov 14 '14 20:11 kayrus

If you tell me how can I realloc already allocated memory using nginx functions - I will provide more optimized solution (less memory and CPU cycles).

Also I have question for "len" and "p - line" values: why are they different?

kayrus avatar Nov 14 '14 21:11 kayrus