Skip to content

Can I ignore some field #48

@memwey

Description

@memwey

Greeting. I find the package is useful and hope you don't mind that I ask a silly question.
In the example, it show the default log string like this.

{"@version": 1,
 "account": "pyr",
 "lineno": 1,
 "levelno": 30,
 "filename": "test.py",
 "thread": 140566036444928,
 "@timestamp": "2015-03-30T09:46:23.000Z",
 "threadName": "MainThread",
 "relativeCreated": 51079.52117919922,
 "process": 10787,
 "source_host": "phoenix.spootnik.org",
 "processName": "MainProcess",
 "pathname": "test.py",
 "args": [],
 "module": "test",
 "msecs": 999.9005794525146,
 "created": 1427708782.9999006,
 "name": "root",
 "stack_info": null,
 "funcName": "<module>",
 "levelname": "WARNING",
 "message": "foo"}

However, I think the outpout information is too much for me. I learn that the necessary field the logstash need is @version and @timestamp. So can I set fmt to ignore some field then the result can be like this.

{"@version": 1,
 "@timestamp": "2015-03-30T09:46:23.000Z",
 "message": "foo"}

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