2020class Event (object ):
2121 """Represents an event or fragment of an event to be written by this modular input to Splunk.
2222
23- To write an input to a stream, call the write_to function, passing in a stream.
23+ To write an input to a stream, call the `` write_to`` function, passing in a stream.
2424 """
2525 def __init__ (self , data = None , stanza = None , time = None , host = None , index = None , source = None ,
2626 sourcetype = None , done = True , unbroken = True ):
2727 """There are no required parameters for constructing an Event
2828
29- Example with minimal configuration:
29+ ** Example with minimal configuration**: :
3030
3131 my_event = Event(
3232 data="This is a test of my new event.",
3333 stanza="myStanzaName",
3434 time="%.3f" % 1372187084.000
3535 )
3636
37- Example with full configuration:
37+ ** Example with full configuration**: :
3838
3939 excellent_event = Event(
4040 data="This is a test of my excellent event.",
@@ -48,15 +48,15 @@ def __init__(self, data=None, stanza=None, time=None, host=None, index=None, sou
4848 unbroken=True
4949 )
5050
51- :param data: string, the event's text
52- :param stanza: string, name of the input this event should be sent to
53- :param time: float, time in seconds, including up to 3 decimal places to represent milliseconds
54- :param host: string, the event's host, ex: localhost
55- :param index: string, the index this event is specified to write to, or None if default index
56- :param source: string, the source of this event, or None to have Splunk guess
57- :param sourcetype: string, source type currently set on this event, or None to have Splunk guess
58- :param done: boolean, is this a complete Event? False if an Event fragment
59- :param unbroken: boolean, Is this event completely encapsulated in this Event object?
51+ :param data: `` string`` , the event's text.
52+ :param stanza: `` string`` , name of the input this event should be sent to.
53+ :param time: `` float`` , time in seconds, including up to 3 decimal places to represent milliseconds.
54+ :param host: `` string`` , the event's host, ex: localhost.
55+ :param index: `` string`` , the index this event is specified to write to, or None if default index.
56+ :param source: `` string`` , the source of this event, or None to have Splunk guess.
57+ :param sourcetype: `` string`` , source type currently set on this event, or None to have Splunk guess.
58+ :param done: `` boolean`` , is this a complete `` Event`` ? False if an `` Event`` fragment.
59+ :param unbroken: `` boolean`` , Is this event completely encapsulated in this `` Event`` object?
6060 """
6161 self .data = data
6262 self .done = done
@@ -69,12 +69,12 @@ def __init__(self, data=None, stanza=None, time=None, host=None, index=None, sou
6969 self .unbroken = unbroken
7070
7171 def write_to (self , stream ):
72- """Write an XML representation of self, an Event object, to the given stream
72+ """Write an XML representation of self, an `` Event`` object, to the given stream.
7373
74- The Event object will only be written if its data field is defined,
75- otherwise a ValueError is raised.
74+ The `` Event`` object will only be written if its data field is defined,
75+ otherwise a `` ValueError`` is raised.
7676
77- :param stream: stream to write XML to
77+ :param stream: stream to write XML to.
7878 """
7979 if self .data is None :
8080 raise ValueError ("Events must have at least the data field set to be written to XML." )
0 commit comments