def _generate_event_doc(event):
    '''
    Create a object that will be saved into the database based in
    options.
    '''

    # Create a copy of the object that we will return.
    eventc = event.copy()

    # Set the ID of the document to be the JID.
    eventc["_id"] = '{}-{}'.format(
                                    event.get('tag', '').split('/')[2],
                                    event.get('tag', '').split('/')[3]
                                  )

    # Add a timestamp field to the document
    eventc["timestamp"] = time.time()

    # remove any return data as it's captured in the "returner" function
    if eventc.get('data').get('return'):
        del eventc['data']['return']

    return eventc
Create a object that will be saved into the database based in
    options.