(g)ULP!
Loading...
Searching...
No Matches
FieldMappingEntry Class Reference
Inheritance diagram for FieldMappingEntry:
Collaboration diagram for FieldMappingEntry:

Public Member Functions

dict to_dict (self)
 

Static Public Member Functions

"FieldMappingEntry" from_dict (dict d)
 

Static Public Attributes

Optional do_multiply
 
Optional event_code
 
Optional is_timestamp
 
Optional is_timestamp_chrome
 
Optional is_variable_mapping
 
Optional map_to
 
dict model_config
 
Optional result
 

Detailed Description

FieldMappingEntry defines how to map a single field, including field-specific options.

Definition at line 87 of file models.py.

Member Function Documentation

◆ from_dict()

"FieldMappingEntry" from_dict ( dict d)
static

Definition at line 144 of file models.py.

144 def from_dict(d: dict) -> "FieldMappingEntry":
145 # print('FieldMappingEntry.from_dict: d=%s, type=%s' % (d, type(d)))
146 fm = FieldMappingEntry(
147 map_to=d.get("map_to", None),
148 event_code=d.get("event_code", None),
149 do_multiply=d.get("do_multiply", None),
150 is_variable_mapping=d.get("is_variable_mapping", False),
151 is_timestamp=d.get("is_timestamp", False),
152 is_timestamp_chrome=d.get("is_timestamp_chrome", False),
153 )
154 # print('FieldMappingEntry.from_dict: fm=%s, type=%s' % (fm, type(fm)))
155 return fm
156

◆ to_dict()

dict to_dict ( self)

Definition at line 133 of file models.py.

133 def to_dict(self) -> dict:
134 d = {
135 "map_to": self.map_to,
136 "is_timestamp": self.is_timestamp,
137 "event_code": self.event_code,
138 "do_multiply": self.do_multiply,
139 "is_timestamp_chrome": self.is_timestamp_chrome,
140 }
141 return d
142

Member Data Documentation

◆ do_multiply

Optional do_multiply
static
Initial value:
= Field(
None,
description="if set and if value is a number, or string representing a number, multiply it by this value (to divide, i.e. multiply by 0.5 to divide by 2).<br>"
'NOTE: ignored if "is_timestamp_chrome" is set, result of the multiply/divide must be **nanoseconds**.',
)

Definition at line 115 of file models.py.

◆ event_code

Optional event_code
static
Initial value:
= Field(
None,
description='if set, overrides "default_event_code" in the GulpMappingOptions (ignored if "is_timestamp" is not set).',
)

Definition at line 120 of file models.py.

◆ is_timestamp

Optional is_timestamp
static
Initial value:
= Field(
False,
description='if True, this field refer to a timestamp and will generate "@timestamp" and "@timestamp_nsec" fields.<br>'
'NOTE: if more than one "is_timestamp" is set in the mapping, multiple events with such "@timestamp" and, possibly, "event.code" are generated.',
)

Definition at line 105 of file models.py.

◆ is_timestamp_chrome

Optional is_timestamp_chrome
static
Initial value:
= Field(
False,
description="if set and if value is a number, or string representing a number, it is interpreted as a chrome/webkit timestamp (with epoch 01/01/1601) and converted to **nanoseconds from unix epoch**.<br>"
'NOTE: ignored if "do_multiply" is set, if set together with "is_timestamp" will generate converted chrome "@timestamp" and "@timestamp_nsec".',
)

Definition at line 110 of file models.py.

◆ is_variable_mapping

Optional is_variable_mapping
static
Initial value:
= Field(
False,
description='INTERNAL USAGE ONLY. if True, indicates the "map_to" field is a variable mapping.',
)

Definition at line 124 of file models.py.

◆ map_to

Optional map_to
static
Initial value:
= Field(
None,
description=,
)

Definition at line 92 of file models.py.

◆ model_config

dict model_config
static
Initial value:
= {
"json_schema_extra": {
"example": {
"map_to": "my_field",
"event_code": "my_event_code",
"is_timestamp": False,
}
}
}

Definition at line 157 of file models.py.

◆ result

Optional result
static
Initial value:
= Field(
None,
description='INTERNAL USAGE ONLY. the destination dict representing the field (i.e. {"@timestamp": 123456}).',
)

Definition at line 128 of file models.py.


The documentation for this class was generated from the following file: