Skip to content

Logcollector: define per-target custom output format strings#863

Merged
chemamartinez merged 1 commit into3.4from
3.4-outformat
Jun 29, 2018
Merged

Logcollector: define per-target custom output format strings#863
chemamartinez merged 1 commit into3.4from
3.4-outformat

Conversation

@vikman90
Copy link
Member

@vikman90 vikman90 commented Jun 27, 2018

Related issue: #830

This PR aims to introduce a new option that will allow defining custom output formats for different targets in the same <localfile> stanza.

<localfile>
  <log_format>syslog</log_format>
  <location>/var/log/syslog</location>
  <target>agent,socket</target>
  <out_format target="socket">$(timestamp %Y-%m-%dT%H:%M:%S): $(log)</out_format>
</localfile>

Added options

Attribute target for option <out_format> in <localfile> stanzas.

<out_format target="custom">custom: $(log)</out_format>
<out_format target="agent">(agent): $(log)</out_format>

This attribute is optional. If it is not defined it will affect all the <target> stanzas except those that have a custom option <out_format> defined.

Unit tests

  • Define <out_format> with default target for some localfiles.
  • Declare <out_format> for the target "agent".
  • Create <out_format> for a custom socket target.
  • Combine <out_format> with a default option and another stanza for a custom socket target.
  • Use <out_format> in localfile stanzas with wildcards (define the option before the location).
  • Use <out_format> in localfile stanzas with wildcards (define the option after the location).
  • Run Logcollector with Valgrind.
  • Declare <out_format> for a target that does not exist.

Copy link
Contributor

@chemamartinez chemamartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything works fine! GJ @vikman90!

@chemamartinez chemamartinez merged commit 351d9fb into 3.4 Jun 29, 2018
@chemamartinez chemamartinez deleted the 3.4-outformat branch June 29, 2018 14:37
@albertomn86 albertomn86 mentioned this pull request Sep 24, 2018
18 tasks
@albertomn86 albertomn86 mentioned this pull request Nov 23, 2018
18 tasks
@chemamartinez chemamartinez mentioned this pull request Jan 9, 2019
18 tasks
@albertomn86 albertomn86 mentioned this pull request Feb 18, 2019
18 tasks
@albertomn86 albertomn86 mentioned this pull request Mar 18, 2019
18 tasks
@albertomn86 albertomn86 mentioned this pull request Apr 25, 2019
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants