<s> import os <EOL> import json <EOL> import pyes <EOL> import cowrie . core . output <EOL> class Output ( cowrie . core . output . Output ) : <EOL> """<STR_LIT:U+0020>""" <EOL> def __init__ ( self , cfg ) : <EOL> """<STR_LIT:U+0020>""" <EOL> self . host = cfg . get ( '<STR_LIT>' , '<STR_LIT:host>' ) <EOL> self . port = cfg . get ( '<STR_LIT>' , '<STR_LIT:port>' ) <EOL> self . index = cfg . get ( '<STR_LIT>' , '<STR_LIT:index>' ) <EOL> self . type = cfg . get ( '<STR_LIT>' , '<STR_LIT:type>' ) <EOL> cowrie . core . output . Output . __init__ ( self , cfg ) <EOL> def start ( self ) : <EOL> """<STR_LIT:U+0020>""" <EOL> self . es = pyes . ES ( '<STR_LIT>' . format ( self . host , self . port ) ) <EOL> def stop ( self ) : <EOL> """<STR_LIT:U+0020>""" <EOL> pass <EOL> def write ( self , logentry ) : <EOL> """<STR_LIT:U+0020>""" <EOL> for i in list ( logentry . keys ( ) ) : <EOL> if i . startswith ( '<STR_LIT>' ) : <EOL> del logentry [ i ] <EOL> self . es . index ( logentry , self . index , self . type ) </s>
