Skip to content

Feature request: Custom formatter for sdjournal reader #253

@Richterrettich

Description

@Richterrettich

At the moment, JournalReader has a fixed message template for each entry. It would be really helpful if I would be able to alter the format.

I have thought of something like this:

config := sdjournal.JournalReaderConfig {
		Formatter: func(entry *JournalEntry) string {
                     return fmt.Sprintf("%s:%s",entry.Fields["MY_CUSTOM_FIELD"])
                },
	}

I can send you a patch if you are okay with this kind of feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions