public class Input extends Object implements Serializable
The Input
class can be used to configured and execute various forms of pipeline raw
event ingestion from external sources.
The class supports two different modes of operation; simplex mode and multiplex mode.
In simplex mode, raw events are read from one or more input sources, and the resulting data set is output in a single flat collection as is.
In multiplex mode, raw events are read from one or more elements, where each element can have one or more input sources. The resulting data set is output in key value pairs, with the key being the element name and the values being data read from the input streams belonging to that particular element.
In both simplex and multiplex mode, the reads can occur in either raw mode or a parsed mode. In raw mode, no attempted parsing of a raw entry will occur, and the resulting data set will simply consist of the raw string data.
To enable parsed mode a parser configuration must be supplied. In this mode, the raw data set
will be passed through the parser with the resulting data set consistent of Event
objects
instead of raw strings.
A filter can be associated with parsed read operations to filter events based on what is desired for a particular element.
Modifier and Type | Class and Description |
---|---|
static class |
Input.MultiplexReader
Read raw events from configured sources, returning a key value collection with the key being
the element name and the value being a parsed event
|
static class |
Input.MultiplexReaderRaw
Read raw events from configured sources, returning a key value collection with the key being
the element name and the value being a raw string
|
static class |
Input.SimplexReader
Read raw events from configured sources, combining all events into a single output collection
as Event objects
|
static class |
Input.SimplexReaderRaw
Read raw events from configured sources, combining all events into a single output collection
as strings
|
Modifier and Type | Field and Description |
---|---|
static String |
SIMPLEX_DEFAULT_ELEMENT
Default simplex element name
|
Constructor and Description |
---|
Input()
Create new input object
|
Input(String project)
Create new input object
|
Modifier and Type | Method and Description |
---|---|
static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<String>> |
compositeInputAdapter(InputOptions options,
String cfgTick)
Adapter to simplify
Input usage for pipelines that used previous composite input
tranform |
Input |
fromPipelineOptions(InputOptions options,
String cfgTickMessage)
Configure input using specified
InputOptions |
InputCollectionCache |
getCache()
Request input collection cache
|
InputElement |
getInputElementByName(String name)
Get an input element by name
|
ArrayList<InputElement> |
getInputElements()
Get input elements
|
com.mozilla.secops.input.Input.OperatingMode |
getOperatingMode()
Get operating mode
|
String |
getProject()
Get project
|
Input |
multiplex()
Enable multiplex mode
|
org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,Event>>> |
multiplexRead()
Return a transform that will ingest data, and emit parsed events in multiplex mode
|
org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,String>>> |
multiplexReadRaw()
Return a transform that will ingest data, and emit raw events in multiplex mode
|
void |
setInputElements(ArrayList<InputElement> elements)
Set input elements
|
void |
setOperatingMode(com.mozilla.secops.input.Input.OperatingMode mode)
Set operating mode
|
void |
setProject(String project)
Set project
|
Input |
simplex()
Enable simplex input mode
|
org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<Event>> |
simplexRead()
Return a transform that will ingest data, and emit parsed events in simplex mode
|
org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<String>> |
simplexReadRaw()
Return a transform that will ingest data, and emit raw strings in simplex mode
|
Input |
withInputElement(InputElement el)
Add input element
|
public static final String SIMPLEX_DEFAULT_ELEMENT
public Input()
public Input(String project)
This variant should be used if any input options require KMS decryption, typically the case for pipelines executing in Dataflow.
project
- GCP projectpublic InputCollectionCache getCache()
This is an internal method and should not generally be called directly.
InputCollectionCache
public static org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<String>> compositeInputAdapter(InputOptions options, String cfgTick) throws IOException
Input
usage for pipelines that used previous composite input
tranformoptions
- InputOptionscfgTick
- Configuration tick message, null if not enabledIOException
- IOExceptionpublic void setOperatingMode(com.mozilla.secops.input.Input.OperatingMode mode)
mode
- Operating modepublic com.mozilla.secops.input.Input.OperatingMode getOperatingMode()
public void setProject(String project)
project
- Project stringpublic String getProject()
public void setInputElements(ArrayList<InputElement> elements)
elements
- Input element arraypublic ArrayList<InputElement> getInputElements()
public InputElement getInputElementByName(String name)
name
- Input element namepublic Input simplex()
public Input fromPipelineOptions(InputOptions options, String cfgTickMessage) throws IOException
InputOptions
This method is only valid in simplex operating mode.
options
- Pipeline input optionscfgTickMessage
- Configuration tick message, null if not enabledIOException
- IOExceptionpublic Input multiplex()
public Input withInputElement(InputElement el) throws IOException
el
- Input elementIOException
- IOExceptionpublic org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<String>> simplexReadRaw()
public org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<Event>> simplexRead()
public org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,String>>> multiplexReadRaw()
public org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PBegin,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<String,Event>>> multiplexRead()
Copyright © 2022. All rights reserved.