![]() Raise Exception( "do_lookup needs to be implemented")ĭef extend_fieldnames( self, fieldnames):Įxtends the list of fieldnames with those that the lookup will create.ĭef add_result( self, result_dict, output_dict, fieldnames): ![]() This is the function that performs the lookup. Formatter( '%(asctime)s %(levelname)s %(message)s') RotatingFileHandler( make_splunkhome_path(), maxBytes = 25000000, backupCount = 5)įormatter = logging. # Prevent the log messages from being duplicated in the python.log file:įile_handler = handlers. # Here is a list of the accepted fieldnames Raise Exception( "The value for fieldnames must include an array of at least one row") If fieldnames is None or len( fieldnames) = 0: # Ensure that the list of the accepted fieldnames is valid # Keep a list of the invalid fields so that we don't re-warn people about the same things Raise Exception( "Logger name cannot be empty") If logger_name is None or len( logger_name) = 0: Log_level - The log level to use for the logger Logger_name - The logger name to append to the logger INFO):Ĭonstructs an instance of the lookup command.įieldnames - A list of the field names that the command will output util import make_splunkhome_pathĭef _init_( self, fieldnames = None, logger_name = 'custom_lookup_command', log_level = logging. Note that this command can be run with:ĬustomLookup._init_(self,, 'echo_lookup_command', logging.INFO)įrom splunk. echo_lookup.py) and the names of the fields that need to be providedĢ.2) The list of fields that the command will generate (usually will include the field passed into it) This is licensed under the Apache License Version 2.0ġ) A lookup command script that implements from CustomLookupĢ) Create a nf that declares your lookup commandĢ.1) The path of your lookup command filename (e.g. This is a base-class for writing custom external lookups.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |