{"modulePath":"github.com/benthosdev/benthos","version":"v0.26.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package processor\n\nPackage processor contains implementations of types.Processor, which perform an arbitrary operation on a message and either returns \u003e0 messages to be propagated towards a sink, or a response to be sent back to the message source.\n\n## Constants\n\n```go\nconst (\n\tTypeArchive      = \"archive\"\n\tTypeBatch        = \"batch\"\n\tTypeBoundsCheck  = \"bounds_check\"\n\tTypeCombine      = \"combine\"\n\tTypeCompress     = \"compress\"\n\tTypeConditional  = \"conditional\"\n\tTypeDecode       = \"decode\"\n\tTypeDecompress   = \"decompress\"\n\tTypeDedupe       = \"dedupe\"\n\tTypeEncode       = \"encode\"\n\tTypeFilter       = \"filter\"\n\tTypeFilterParts  = \"filter_parts\"\n\tTypeGrok         = \"grok\"\n\tTypeHash         = \"hash\"\n\tTypeHashSample   = \"hash_sample\"\n\tTypeHTTP         = \"http\"\n\tTypeInsertPart   = \"insert_part\"\n\tTypeJMESPath     = \"jmespath\"\n\tTypeJSON         = \"json\"\n\tTypeMergeJSON    = \"merge_json\"\n\tTypeMetadata     = \"metadata\"\n\tTypeMetric       = \"metric\"\n\tTypeNoop         = \"noop\"\n\tTypeProcessField = \"process_field\"\n\tTypeProcessMap   = \"process_map\"\n\tTypeSample       = \"sample\"\n\tTypeSelectParts  = \"select_parts\"\n\tTypeSplit        = \"split\"\n\tTypeText         = \"text\"\n\tTypeThrottle     = \"throttle\"\n\tTypeUnarchive    = \"unarchive\"\n)\n```\nString constants representing each processor type.\n\n## Variables\n\n```go\nvar Constructors = map[string]TypeSpec{}\n```\nConstructors is a map of all processor types with their specs.\n\n## Functions\n\n```go\nfunc Descriptions() string\n```\nDescriptions returns a formatted string of collated descriptions of each type.\n\n```go\nfunc SanitiseConfig(conf Config) (interface{}, error)\n```\nSanitiseConfig returns a sanitised version of the Config, meaning sections that aren't relevant to behaviour are removed.\n\n## Types\n\n```go\ntype Archive struct {\n\t// contains filtered or unexported fields\n}\n```\nArchive is a processor that can selectively archive parts of a message into a single part using a chosen archive type.\n\n```go\nfunc (d *Archive) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype ArchiveConfig struct {\n\tFormat string `json:\"format\" yaml:\"format\"`\n\tPath   string `json:\"path\" yaml:\"path\"`\n}\n```\nArchiveConfig contains configuration fields for the Archive processor.\n\n```go\nfunc NewArchiveConfig() ArchiveConfig\n```\nNewArchiveConfig returns a ArchiveConfig with default values.\n\n```go\ntype Batch struct {\n\t// contains filtered or unexported fields\n}\n```\nBatch is a processor that combines messages into a batch until a size limit or other condition is reached, at which point the batch is sent out. When a message is combined without yet producing a batch a NoAck response is returned, which is interpretted as source types as an instruction to send another message through but hold off on acknowledging this one.\n\nEventually, when the batch reaches its target size, the batch is sent through the pipeline as a single message and an acknowledgement for that message determines whether the whole batch of messages are acknowledged.\n\n```go\nfunc (c *Batch) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype BatchConfig struct {\n\tByteSize  int              `json:\"byte_size\" yaml:\"byte_size\"`\n\tCondition condition.Config `json:\"condition\" yaml:\"condition\"`\n\tPeriodMS  int              `json:\"period_ms\" yaml:\"period_ms\"`\n}\n```\nBatchConfig contains configuration fields for the Batch processor.\n\n```go\nfunc NewBatchConfig() BatchConfig\n```\nNewBatchConfig returns a BatchConfig with default values.\n\n```go\ntype BoundsCheck struct {\n\t// contains filtered or unexported fields\n}\n```\nBoundsCheck is a processor that checks each message against a set of bounds and rejects messages if they aren't within them.\n\n```go\nfunc (m *BoundsCheck) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype BoundsCheckConfig struct {\n\tMaxParts    int `json:\"max_parts\" yaml:\"max_parts\"`\n\tMinParts    int `json:\"min_parts\" yaml:\"min_parts\"`\n\tMaxPartSize int `json:\"max_part_size\" yaml:\"max_part_size\"`\n\tMinPartSize int `json:\"min_part_size\" yaml:\"min_part_size\"`\n}\n```\nBoundsCheckConfig contains configuration fields for the BoundsCheck processor.\n\n```go\nfunc NewBoundsCheckConfig() BoundsCheckConfig\n```\nNewBoundsCheckConfig returns a BoundsCheckConfig with default values.\n\n```go\ntype Combine struct {\n\t// contains filtered or unexported fields\n}\n```\nCombine is a processor that combines messages into a batch until a target number of message parts is reached, at which point the batch is sent out. When a message is combined without yet producing a batch a NoAck response is returned, which is interpretted as source types as an instruction to send another message through but hold off on acknowledging this one.\n\nEventually, when the batch reaches its target size, the batch is sent through the pipeline as a single message and an acknowledgement for that message determines whether the whole batch of messages are acknowledged.\n\n```go\nfunc (c *Combine) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype CombineConfig struct {\n\tParts int `json:\"parts\" yaml:\"parts\"`\n}\n```\nCombineConfig contains configuration fields for the Combine processor.\n\n```go\nfunc NewCombineConfig() CombineConfig\n```\nNewCombineConfig returns a CombineConfig with default values.\n\n```go\ntype Compress struct {\n\t// contains filtered or unexported fields\n}\n```\nCompress is a processor that can selectively compress parts of a message as a chosen compression algorithm.\n\n```go\nfunc (c *Compress) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype CompressConfig struct {\n\tAlgorithm string `json:\"algorithm\" yaml:\"algorithm\"`\n\tLevel     int    `json:\"level\" yaml:\"level\"`\n\tParts     []int  `json:\"parts\" yaml:\"parts\"`\n}\n```\nCompressConfig contains configuration fields for the Compress processor.\n\n```go\nfunc NewCompressConfig() CompressConfig\n```\nNewCompressConfig returns a CompressConfig with default values.\n\n```go\ntype Conditional struct {\n\t// contains filtered or unexported fields\n}\n```\nConditional is a processor that only applies child processors under a certain condition.\n\n```go\nfunc (c *Conditional) ProcessMessage(msg types.Message) (msgs []types.Message, res types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype ConditionalConfig struct {\n\tCondition      condition.Config `json:\"condition\" yaml:\"condition\"`\n\tProcessors     []Config         `json:\"processors\" yaml:\"processors\"`\n\tElseProcessors []Config         `json:\"else_processors\" yaml:\"else_processors\"`\n}\n```\nConditionalConfig is a config struct containing fields for the Conditional processor.\n\n```go\nfunc NewConditionalConfig() ConditionalConfig\n```\nNewConditionalConfig returns a default ConditionalConfig.\n\n```go\ntype Config struct {\n\tType         string             `json:\"type\" yaml:\"type\"`\n\tArchive      ArchiveConfig      `json:\"archive\" yaml:\"archive\"`\n\tBatch        BatchConfig        `json:\"batch\" yaml:\"batch\"`\n\tBoundsCheck  BoundsCheckConfig  `json:\"bounds_check\" yaml:\"bounds_check\"`\n\tCombine      CombineConfig      `json:\"combine\" yaml:\"combine\"`\n\tCompress     CompressConfig     `json:\"compress\" yaml:\"compress\"`\n\tConditional  ConditionalConfig  `json:\"conditional\" yaml:\"conditional\"`\n\tDecode       DecodeConfig       `json:\"decode\" yaml:\"decode\"`\n\tDecompress   DecompressConfig   `json:\"decompress\" yaml:\"decompress\"`\n\tDedupe       DedupeConfig       `json:\"dedupe\" yaml:\"dedupe\"`\n\tEncode       EncodeConfig       `json:\"encode\" yaml:\"encode\"`\n\tFilter       FilterConfig       `json:\"filter\" yaml:\"filter\"`\n\tFilterParts  FilterPartsConfig  `json:\"filter_parts\" yaml:\"filter_parts\"`\n\tGrok         GrokConfig         `json:\"grok\" yaml:\"grok\"`\n\tHash         HashConfig         `json:\"hash\" yaml:\"hash\"`\n\tHashSample   HashSampleConfig   `json:\"hash_sample\" yaml:\"hash_sample\"`\n\tHTTP         HTTPConfig         `json:\"http\" yaml:\"http\"`\n\tInsertPart   InsertPartConfig   `json:\"insert_part\" yaml:\"insert_part\"`\n\tJMESPath     JMESPathConfig     `json:\"jmespath\" yaml:\"jmespath\"`\n\tJSON         JSONConfig         `json:\"json\" yaml:\"json\"`\n\tMergeJSON    MergeJSONConfig    `json:\"merge_json\" yaml:\"merge_json\"`\n\tMetadata     MetadataConfig     `json:\"metadata\" yaml:\"metadata\"`\n\tMetric       MetricConfig       `json:\"metric\" yaml:\"metric\"`\n\tProcessField ProcessFieldConfig `json:\"process_field\" yaml:\"process_field\"`\n\tProcessMap   ProcessMapConfig   `json:\"process_map\" yaml:\"process_map\"`\n\tSample       SampleConfig       `json:\"sample\" yaml:\"sample\"`\n\tSelectParts  SelectPartsConfig  `json:\"select_parts\" yaml:\"select_parts\"`\n\tSplit        SplitConfig        `json:\"split\" yaml:\"split\"`\n\tText         TextConfig         `json:\"text\" yaml:\"text\"`\n\tThrottle     ThrottleConfig     `json:\"throttle\" yaml:\"throttle\"`\n\tUnarchive    UnarchiveConfig    `json:\"unarchive\" yaml:\"unarchive\"`\n}\n```\nConfig is the all encompassing configuration struct for all processor types.\n\n```go\nfunc NewConfig() Config\n```\nNewConfig returns a configuration struct fully populated with default values.\n\n```go\nfunc (m *Config) UnmarshalJSON(bytes []byte) error\n```\nUnmarshalJSON ensures that when parsing configs that are in a slice the default values are still applied.\n\n```go\nfunc (m *Config) UnmarshalYAML(unmarshal func(interface{}) error) error\n```\nUnmarshalYAML ensures that when parsing configs that are in a slice the default values are still applied.\n\n```go\ntype Decode struct {\n\t// contains filtered or unexported fields\n}\n```\nDecode is a processor that can selectively decode parts of a message following a chosen scheme.\n\n```go\nfunc (c *Decode) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype DecodeConfig struct {\n\tScheme string `json:\"scheme\" yaml:\"scheme\"`\n\tParts  []int  `json:\"parts\" yaml:\"parts\"`\n}\n```\nDecodeConfig contains configuration fields for the Decode processor.\n\n```go\nfunc NewDecodeConfig() DecodeConfig\n```\nNewDecodeConfig returns a DecodeConfig with default values.\n\n```go\ntype Decompress struct {\n\t// contains filtered or unexported fields\n}\n```\nDecompress is a processor that can decompress parts of a message following a chosen compression algorithm.\n\n```go\nfunc (d *Decompress) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype DecompressConfig struct {\n\tAlgorithm string `json:\"algorithm\" yaml:\"algorithm\"`\n\tParts     []int  `json:\"parts\" yaml:\"parts\"`\n}\n```\nDecompressConfig contains configuration fields for the Decompress processor.\n\n```go\nfunc NewDecompressConfig() DecompressConfig\n```\nNewDecompressConfig returns a DecompressConfig with default values.\n\n```go\ntype Dedupe struct {\n\t// contains filtered or unexported fields\n}\n```\nDedupe is a processor that deduplicates messages either by hashing the full contents of message parts or by hashing the value of an interpolated string.\n\n```go\nfunc (d *Dedupe) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype DedupeConfig struct {\n\tCache          string `json:\"cache\" yaml:\"cache\"`\n\tHashType       string `json:\"hash\" yaml:\"hash\"`\n\tParts          []int  `json:\"parts\" yaml:\"parts\"` // message parts to hash\n\tKey            string `json:\"key\" yaml:\"key\"`\n\tDropOnCacheErr bool   `json:\"drop_on_err\" yaml:\"drop_on_err\"`\n}\n```\nDedupeConfig contains configuration fields for the Dedupe processor.\n\n```go\nfunc NewDedupeConfig() DedupeConfig\n```\nNewDedupeConfig returns a DedupeConfig with default values.\n\n```go\ntype Encode struct {\n\t// contains filtered or unexported fields\n}\n```\nEncode is a processor that can selectively encode parts of a message following a chosen scheme.\n\n```go\nfunc (c *Encode) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype EncodeConfig struct {\n\tScheme string `json:\"scheme\" yaml:\"scheme\"`\n\tParts  []int  `json:\"parts\" yaml:\"parts\"`\n}\n```\nEncodeConfig contains configuration fields for the Encode processor.\n\n```go\nfunc NewEncodeConfig() EncodeConfig\n```\nNewEncodeConfig returns a EncodeConfig with default values.\n\n```go\ntype Filter struct {\n\t// contains filtered or unexported fields\n}\n```\nFilter is a processor that checks each message against a condition and rejects the message if a condition returns false.\n\n```go\nfunc (c *Filter) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype FilterConfig struct {\n\tcondition.Config `json:\",inline\" yaml:\",inline\"`\n}\n```\nFilterConfig contains configuration fields for the Filter processor.\n\n```go\nfunc NewFilterConfig() FilterConfig\n```\nNewFilterConfig returns a FilterConfig with default values.\n\n```go\ntype FilterParts struct {\n\t// contains filtered or unexported fields\n}\n```\nFilterParts is a processor that checks each part from a message against a condition and removes the part if the condition returns false.\n\n```go\nfunc (c *FilterParts) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype FilterPartsConfig struct {\n\tcondition.Config `json:\",inline\" yaml:\",inline\"`\n}\n```\nFilterPartsConfig contains configuration fields for the FilterParts processor.\n\n```go\nfunc NewFilterPartsConfig() FilterPartsConfig\n```\nNewFilterPartsConfig returns a FilterPartsConfig with default values.\n\n```go\ntype Grok struct {\n\t// contains filtered or unexported fields\n}\n```\nGrok is a processor that executes Grok queries on a message part and replaces the contents with the result.\n\n```go\nfunc (g *Grok) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype GrokConfig struct {\n\tParts       []int    `json:\"parts\" yaml:\"parts\"`\n\tPatterns    []string `json:\"patterns\" yaml:\"patterns\"`\n\tRemoveEmpty bool     `json:\"remove_empty_values\" yaml:\"remove_empty_values\"`\n\tNamedOnly   bool     `json:\"named_captures_only\" yaml:\"named_captures_only\"`\n\tUseDefaults bool     `json:\"use_default_patterns\" yaml:\"use_default_patterns\"`\n\tTo          string   `json:\"output_format\" yaml:\"output_format\"`\n}\n```\nGrokConfig contains configuration fields for the Grok processor.\n\n```go\nfunc NewGrokConfig() GrokConfig\n```\nNewGrokConfig returns a GrokConfig with default values.\n\n```go\ntype HTTP struct {\n\t// contains filtered or unexported fields\n}\n```\nHTTP is a processor that performs an HTTP request using the message as the request body, and returns the response.\n\n```go\nfunc (h *HTTP) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype HTTPConfig struct {\n\tClient      client.Config `json:\"request\" yaml:\"request\"`\n\tParallel    bool          `json:\"parallel\" yaml:\"parallel\"`\n\tMaxParallel int           `json:\"max_parallel\" yaml:\"max_parallel\"`\n}\n```\nHTTPConfig contains configuration fields for the HTTP processor.\n\n```go\nfunc NewHTTPConfig() HTTPConfig\n```\nNewHTTPConfig returns a HTTPConfig with default values.\n\n```go\ntype Hash struct {\n\t// contains filtered or unexported fields\n}\n```\nHash is a processor that can selectively hash parts of a message following a chosen algorithm.\n\n```go\nfunc (c *Hash) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype HashConfig struct {\n\tParts     []int  `json:\"parts\" yaml:\"parts\"`\n\tAlgorithm string `json:\"algorithm\" yaml:\"algorithm\"`\n}\n```\nHashConfig contains configuration fields for the Hash processor.\n\n```go\nfunc NewHashConfig() HashConfig\n```\nNewHashConfig returns a HashConfig with default values.\n\n```go\ntype HashSample struct {\n\t// contains filtered or unexported fields\n}\n```\nHashSample is a processor that removes messages based on a sample factor by hashing its contents.\n\n```go\nfunc (s *HashSample) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype HashSampleConfig struct {\n\tRetainMin float64 `json:\"retain_min\" yaml:\"retain_min\"`\n\tRetainMax float64 `json:\"retain_max\" yaml:\"retain_max\"`\n\tParts     []int   `json:\"parts\" yaml:\"parts\"` // message parts to hash\n}\n```\nHashSampleConfig contains configuration fields for the HashSample processor.\n\n```go\nfunc NewHashSampleConfig() HashSampleConfig\n```\nNewHashSampleConfig returns a HashSampleConfig with default values.\n\n```go\ntype InsertPart struct {\n\t// contains filtered or unexported fields\n}\n```\nInsertPart is a processor that inserts a new message part at a specific index.\n\n```go\nfunc (p *InsertPart) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype InsertPartConfig struct {\n\tIndex   int    `json:\"index\" yaml:\"index\"`\n\tContent string `json:\"content\" yaml:\"content\"`\n}\n```\nInsertPartConfig contains configuration fields for the InsertPart processor.\n\n```go\nfunc NewInsertPartConfig() InsertPartConfig\n```\nNewInsertPartConfig returns a InsertPartConfig with default values.\n\n```go\ntype JMESPath struct {\n\t// contains filtered or unexported fields\n}\n```\nJMESPath is a processor that executes JMESPath queries on a message part and replaces the contents with the result.\n\n```go\nfunc (p *JMESPath) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype JMESPathConfig struct {\n\tParts []int  `json:\"parts\" yaml:\"parts\"`\n\tQuery string `json:\"query\" yaml:\"query\"`\n}\n```\nJMESPathConfig contains configuration fields for the JMESPath processor.\n\n```go\nfunc NewJMESPathConfig() JMESPathConfig\n```\nNewJMESPathConfig returns a JMESPathConfig with default values.\n\n```go\ntype JSON struct {\n\t// contains filtered or unexported fields\n}\n```\nJSON is a processor that performs an operation on a JSON payload.\n\n```go\nfunc (p *JSON) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype JSONConfig struct {\n\tParts    []int        `json:\"parts\" yaml:\"parts\"`\n\tOperator string       `json:\"operator\" yaml:\"operator\"`\n\tPath     string       `json:\"path\" yaml:\"path\"`\n\tValue    rawJSONValue `json:\"value\" yaml:\"value\"`\n}\n```\nJSONConfig contains configuration fields for the JSON processor.\n\n```go\nfunc NewJSONConfig() JSONConfig\n```\nNewJSONConfig returns a JSONConfig with default values.\n\n```go\ntype MergeJSON struct {\n\t// contains filtered or unexported fields\n}\n```\nMergeJSON is a processor that merges JSON parsed message parts into a single value.\n\n```go\nfunc (p *MergeJSON) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype MergeJSONConfig struct {\n\tParts       []int `json:\"parts\" yaml:\"parts\"`\n\tRetainParts bool  `json:\"retain_parts\" yaml:\"retain_parts\"`\n}\n```\nMergeJSONConfig contains configuration fields for the MergeJSON processor.\n\n```go\nfunc NewMergeJSONConfig() MergeJSONConfig\n```\nNewMergeJSONConfig returns a MergeJSONConfig with default values.\n\n```go\ntype Metadata struct {\n\t// contains filtered or unexported fields\n}\n```\nMetadata is a processor that performs an operation on the Metadata of a message.\n\n```go\nfunc (p *Metadata) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype MetadataConfig struct {\n\tParts    []int  `json:\"parts\" yaml:\"parts\"`\n\tOperator string `json:\"operator\" yaml:\"operator\"`\n\tKey      string `json:\"key\" yaml:\"key\"`\n\tValue    string `json:\"value\" yaml:\"value\"`\n}\n```\nMetadataConfig contains configuration fields for the Metadata processor.\n\n```go\nfunc NewMetadataConfig() MetadataConfig\n```\nNewMetadataConfig returns a MetadataConfig with default values.\n\n```go\ntype Metric struct {\n\t// contains filtered or unexported fields\n}\n```\nMetric is a processor that creates a metric from extracted values from a message part.\n\n```go\nfunc (m *Metric) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message\n\n```go\ntype MetricConfig struct {\n\tType   string            `json:\"type\" yaml:\"type\"`\n\tPath   string            `json:\"path\" yaml:\"path\"`\n\tLabels map[string]string `json:\"labels\" yaml:\"labels\"`\n\tValue  string            `json:\"value\" yaml:\"value\"`\n}\n```\nMetricConfig contains configuration fields for the Metric processor.\n\n```go\nfunc NewMetricConfig() MetricConfig\n```\nNewMetricConfig returns a MetricConfig with default values.\n\n```go\ntype Noop struct {\n}\n```\nNoop is a no-op processor that does nothing.\n\n```go\nfunc (c *Noop) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage does nothing and returns the message unchanged.\n\n```go\ntype ProcessField struct {\n\t// contains filtered or unexported fields\n}\n```\nProcessField is a processor that applies a list of child processors to a field extracted from the original payload.\n\n```go\nfunc (p *ProcessField) ProcessMessage(msg types.Message) (msgs []types.Message, res types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype ProcessFieldConfig struct {\n\tParts      []int    `json:\"parts\" yaml:\"parts\"`\n\tPath       string   `json:\"path\" yaml:\"path\"`\n\tProcessors []Config `json:\"processors\" yaml:\"processors\"`\n}\n```\nProcessFieldConfig is a config struct containing fields for the ProcessField processor.\n\n```go\nfunc NewProcessFieldConfig() ProcessFieldConfig\n```\nNewProcessFieldConfig returns a default ProcessFieldConfig.\n\n```go\ntype ProcessMap struct {\n\t// contains filtered or unexported fields\n}\n```\nProcessMap is a processor that applies a list of child processors to a new payload mapped from the original, and after processing attempts to overlay the results back onto the original payloads according to more mappings.\n\n```go\nfunc (p *ProcessMap) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype ProcessMapConfig struct {\n\tParts           []int              `json:\"parts\" yaml:\"parts\"`\n\tConditions      []condition.Config `json:\"conditions\" yaml:\"conditions\"`\n\tPremap          map[string]string  `json:\"premap\" yaml:\"premap\"`\n\tPremapOptional  map[string]string  `json:\"premap_optional\" yaml:\"premap_optional\"`\n\tPostmap         map[string]string  `json:\"postmap\" yaml:\"postmap\"`\n\tPostmapOptional map[string]string  `json:\"postmap_optional\" yaml:\"postmap_optional\"`\n\tProcessors      []Config           `json:\"processors\" yaml:\"processors\"`\n}\n```\nProcessMapConfig is a config struct containing fields for the ProcessMap processor.\n\n```go\nfunc NewProcessMapConfig() ProcessMapConfig\n```\nNewProcessMapConfig returns a default ProcessMapConfig.\n\n```go\ntype Sample struct {\n\t// contains filtered or unexported fields\n}\n```\nSample is a processor that drops messages based on a random sample.\n\n```go\nfunc (s *Sample) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype SampleConfig struct {\n\tRetain     float64 `json:\"retain\" yaml:\"retain\"`\n\tRandomSeed int64   `json:\"seed\" yaml:\"seed\"`\n}\n```\nSampleConfig contains configuration fields for the Sample processor.\n\n```go\nfunc NewSampleConfig() SampleConfig\n```\nNewSampleConfig returns a SampleConfig with default values.\n\n```go\ntype SelectParts struct {\n\t// contains filtered or unexported fields\n}\n```\nSelectParts is a processor that selects parts from a message to append to a new message.\n\n```go\nfunc (m *SelectParts) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype SelectPartsConfig struct {\n\tParts []int `json:\"parts\" yaml:\"parts\"`\n}\n```\nSelectPartsConfig contains configuration fields for the SelectParts processor.\n\n```go\nfunc NewSelectPartsConfig() SelectPartsConfig\n```\nNewSelectPartsConfig returns a SelectPartsConfig with default values.\n\n```go\ntype Split struct {\n\t// contains filtered or unexported fields\n}\n```\nSplit is a processor that splits messages into a message per part.\n\n```go\nfunc (s *Split) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype SplitConfig struct {\n\tSize int `json:\"size\" yaml:\"size\"`\n}\n```\nSplitConfig is a configuration struct containing fields for the Split processor, which breaks message batches down into batches of a smaller size.\n\n```go\nfunc NewSplitConfig() SplitConfig\n```\nNewSplitConfig returns a SplitConfig with default values.\n\n```go\ntype Text struct {\n\t// contains filtered or unexported fields\n}\n```\nText is a processor that performs a text based operation on a payload.\n\n```go\nfunc (t *Text) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype TextConfig struct {\n\tParts    []int  `json:\"parts\" yaml:\"parts\"`\n\tOperator string `json:\"operator\" yaml:\"operator\"`\n\tArg      string `json:\"arg\" yaml:\"arg\"`\n\tValue    string `json:\"value\" yaml:\"value\"`\n}\n```\nTextConfig contains configuration fields for the Text processor.\n\n```go\nfunc NewTextConfig() TextConfig\n```\nNewTextConfig returns a TextConfig with default values.\n\n```go\ntype Throttle struct {\n\t// contains filtered or unexported fields\n}\n```\nThrottle is a processor that limits the stream of a pipeline to one message batch per period specified.\n\n```go\nfunc (m *Throttle) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype ThrottleConfig struct {\n\tPeriod string `json:\"period\" yaml:\"period\"`\n}\n```\nThrottleConfig contains configuration fields for the Throttle processor.\n\n```go\nfunc NewThrottleConfig() ThrottleConfig\n```\nNewThrottleConfig returns a ThrottleConfig with default values.\n\n```go\ntype Type interface {\n\t// ProcessMessage attempts to process a message. Since processing can fail\n\t// this call returns both a slice of messages in case of success or a\n\t// response in case of failure. If the slice of messages is empty the\n\t// response should be returned to the source.\n\tProcessMessage(msg types.Message) ([]types.Message, types.Response)\n}\n```\nType reads a message, performs a processing operation, and returns either a slice of messages resulting from the process to be propagated through the pipeline, or a response that should be sent back to the source instead.\n\n```go\nfunc New(\n\tconf Config,\n\tmgr types.Manager,\n\tlog log.Modular,\n\tstats metrics.Type,\n) (Type, error)\n```\nNew creates a processor type based on a processor configuration.\n\n```go\nfunc NewArchive(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewArchive returns a Archive processor.\n\n```go\nfunc NewBatch(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewBatch returns a Batch processor.\n\n```go\nfunc NewBoundsCheck(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewBoundsCheck returns a BoundsCheck processor.\n\n```go\nfunc NewCombine(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewCombine returns a Combine processor.\n\n```go\nfunc NewCompress(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewCompress returns a Compress processor.\n\n```go\nfunc NewConditional(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewConditional returns a Conditional processor.\n\n```go\nfunc NewDecode(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewDecode returns a Decode processor.\n\n```go\nfunc NewDecompress(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewDecompress returns a Decompress processor.\n\n```go\nfunc NewDedupe(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewDedupe returns a Dedupe processor.\n\n```go\nfunc NewEncode(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewEncode returns a Encode processor.\n\n```go\nfunc NewFilter(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewFilter returns a Filter processor.\n\n```go\nfunc NewFilterParts(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewFilterParts returns a FilterParts processor.\n\n```go\nfunc NewGrok(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewGrok returns a Grok processor.\n\n```go\nfunc NewHTTP(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewHTTP returns a HTTP processor.\n\n```go\nfunc NewHash(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewHash returns a Hash processor.\n\n```go\nfunc NewHashSample(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewHashSample returns a HashSample processor.\n\n```go\nfunc NewInsertPart(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewInsertPart returns a InsertPart processor.\n\n```go\nfunc NewJMESPath(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewJMESPath returns a JMESPath processor.\n\n```go\nfunc NewJSON(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewJSON returns a JSON processor.\n\n```go\nfunc NewMergeJSON(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewMergeJSON returns a MergeJSON processor.\n\n```go\nfunc NewMetadata(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewMetadata returns a Metadata processor.\n\n```go\nfunc NewMetric(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewMetric returns a Metric processor.\n\n```go\nfunc NewNoop(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewNoop returns a Noop processor.\n\n```go\nfunc NewProcessField(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewProcessField returns a ProcessField processor.\n\n```go\nfunc NewProcessMap(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewProcessMap returns a ProcessField processor.\n\n```go\nfunc NewSample(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewSample returns a Sample processor.\n\n```go\nfunc NewSelectParts(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewSelectParts returns a SelectParts processor.\n\n```go\nfunc NewSplit(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewSplit returns a Split processor.\n\n```go\nfunc NewText(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewText returns a Text processor.\n\n```go\nfunc NewThrottle(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewThrottle returns a Throttle processor.\n\n```go\nfunc NewUnarchive(\n\tconf Config, mgr types.Manager, log log.Modular, stats metrics.Type,\n) (Type, error)\n```\nNewUnarchive returns a Unarchive processor.\n\n```go\ntype TypeSpec struct {\n\t// contains filtered or unexported fields\n}\n```\nTypeSpec Constructor and a usage description for each processor type.\n\n```go\ntype Unarchive struct {\n\t// contains filtered or unexported fields\n}\n```\nUnarchive is a processor that can selectively unarchive parts of a message following a chosen archive type.\n\n```go\nfunc (d *Unarchive) ProcessMessage(msg types.Message) ([]types.Message, types.Response)\n```\nProcessMessage applies the processor to a message, either creating \u003e0 resulting messages or a response to be sent back to the message source.\n\n```go\ntype UnarchiveConfig struct {\n\tFormat string `json:\"format\" yaml:\"format\"`\n\tParts  []int  `json:\"parts\" yaml:\"parts\"`\n}\n```\nUnarchiveConfig contains configuration fields for the Unarchive processor.\n\n```go\nfunc NewUnarchiveConfig() UnarchiveConfig\n```\nNewUnarchiveConfig returns a UnarchiveConfig with default values.\n\n","path":"github.com/benthosdev/benthos/lib/processor","name":"processor","synopsis":"Package processor contains implementations of types.Processor, which perform an arbitrary operation on a message and either returns \u003e0 messages to be propagated towards a sink, or a response to be sent back to the message source.","isRedistributable":true}
