pengutils.utils.util_base module¶
Utility Base Functions¶
This module provides utility functions for wrapping and executing filtered queries on event databases. It is designed to be used by CLI scripts for querying and outputting event data, supporting flexible filtering and output options.
Example usage¶
from pengutils.utils.util_base import wrapper
def my_filter(sess, arg1, arg2):
# ...filter logic...
return query
wrapper(results_path, output_path, print_procname, follow, my_filter, (arg1, arg2))
Functions¶
wrapper: Handles session setup, filtering, and output for event queries.
- pengutils.utils.util_base.get_default_results_path()[source]¶
Get the default results path.
Returns¶
- str
Default results path.
- pengutils.utils.util_base.wrapper(results, output, print_procname, follow, filter_func, args)[source]¶
Wrapper function to execute a filtered query and output results.
Parameters¶
- resultsstr
Path to results folder.
- outputstr
Output file path (default:
/dev/stdout).- print_procnamebool
Whether to print the process name in output.
- followbool
Whether to show latest results as they appear.
- filter_funccallable
Function to filter the query. Should accept (sess,
*args).- argstuple
Arguments to pass to the filter function.
Returns¶
None