esppy.connectors.FilePublisher

class esppy.connectors.FilePublisher(fsname=None, fstype=None, name=None, is_active=None, snapshot=None, addcsvflags=None, addcsvopcode=None, blocksize=None, cefsyslogprefix=None, configfilesection=None, csvfielddelimiter=None, dateformat=None, growinginputfile=None, header=None, ignorecsvparseerrors=None, maxevents=None, noautogenfield=None, prebuffer=None, publishwithupsert=None, rate=None, repeatcount=None, transactional=None)

Bases: esppy.connectors.base.Connector

Publish events from a file

Parameters
fsnamestring

The filename or path of the file

fstypestring, optional

The data file type. Valid values: ‘binary’, ‘csv’, ‘xml’, ‘json’, ‘syslog’, ‘hdat’, ‘cef’

namestring, optional

Name of the connector object

snapshotboolean, optional

Specifies whether to send snapshot data

addcsvflagsstring, optional

Specifies the event type to insert into input CSV events. Valid values: ‘normal’ or ‘partialupdate’

addcsvopcodestring, optional

Prepends an opcode and comma to input CSV events.

blocksizeint, optional

Specifies the number of events to include in a published event block

cefsyslogprefixstring, optional

When fstype=cef, specifies that CEF events contain the syslog prefix

configfilesectionstring, optional

Specifies the name of the section in the ESP connector config file for parameters.

csvfielddelimiterstring, optional

Specifies the character delimiter for field data in input CSV events

dateformatstring, optional

Specifies the format of datetime and timestamp fields

growinginputfileboolean, optional

Enables reading from a growing input file by publishers

headerint, optional

Specifies the number of input lines to skip before starting publish operations.

ignorecsvparseerrorsboolean, optional

Specifies that when a field in an input CSV event cannot be parsed, the event is dropped, an error is logged, and publishing continues.

maxeventsint, optional

Specifies the maximum number of events to publish

noautogenfieldboolean, optional

Specifies that input events are missing the key field that is autogenerated by the source window.

prebufferboolean, optional

Controls whether event blocks are buffered to an event block vector before doing any injects.

publishwithupsertboolean, optional

Build events with opcode=upsert instead of insert

rateint, optional

Specifies the requested transmit rate in events per second

repeatcountint, optional

Specifies the number of times to repeat the publish operation

transactionalstring, optional

Sets the event block type to transactional.

Returns
FilePublisher
__init__(self, fsname=None, fstype=None, name=None, is_active=None, snapshot=None, addcsvflags=None, addcsvopcode=None, blocksize=None, cefsyslogprefix=None, configfilesection=None, csvfielddelimiter=None, dateformat=None, growinginputfile=None, header=None, ignorecsvparseerrors=None, maxevents=None, noautogenfield=None, prebuffer=None, publishwithupsert=None, rate=None, repeatcount=None, transactional=None)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self[, fsname, fstype, name, …])

Initialize self.

clear(self)

copy(self[, deep])

Return a copy of the object

from_element(data[, session])

Construct connector from XML definition

from_parameters(conncls[, type, name, …])

from_xml(data[, session])

Construct connector from XML definition

get(self, key[, default])

items(self)

keys(self)

pop(self, key[, default])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem(self)

as a 2-tuple; but raise KeyError if D is empty.

set_properties(self, \*\*kwargs)

Set connector properties

setdefault(self, key[, default])

to_element(self)

Export connector definition to ElementTree.Element

to_xml(self[, pretty])

Export connector definition to XML

update(\*args, \*\*kwds)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values(self)

Attributes

connector_key

property_defs