mirror of
https://github.com/netdata/netdata.git
synced 2025-04-14 17:48:37 +00:00

* make the title metadta the H1 * Update collectors/python.d.plugin/zscores/README.md * Update libnetdata/ebpf/README.md * Update ml/README.md * Update libnetdata/string/README.md --------- Co-authored-by: Chris Akritidis <43294513+cakrit@users.noreply.github.com>
1 KiB
1 KiB
Parser
Introduction
Generic parser that is used to register keywords and a corresponding function that will be executed when that keyword is encountered in the command stream (either from plugins or via streaming)
To use a parser do the following:
- Define a structure that will be used to share user state across calls (user defined
void *user
) - Initialize the parser using
parser_init
- Register keywords with their associated callback function using
parser_add_keyword
- Start a loop for as long there is input (or parser_action returns error)
- Fetch the next line using
parser_next
(if needed) - Process the line using
parser_action
- Fetch the next line using
- Release the parser using
parser_destroy
- Release the user structure
See examples in receiver.c / pluginsd_parser.c