Skip to content

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Parse LOG

rust tail implementation to parse files

Features

  • Load N lines or all lines
  • search and ignore lines with certain strings
  • parse lines and extract what you want

URL

https://pypi.org/project/parse-log/

Usage

importtailpath_to_file='path/to/file/thefile.log'number_of_lines=3#return 3 linestail.lines(path_to_file, number_of_lines)
#return all lines with the given search string#or 'search1, search2'tail.search_all(path_to_file, 'Search_String')
#return all lines with the given search string#or 'search1, search2' also 'ignore1, ignore2' and so ontail.isearch_all(path_to_file, 'Search_String', 'Ignore_String')
#search through all lines contains certain string condition#or 'search1, search2' also 'ignore1, ignore2' and so ontail.search_lines(path_to_file, "search", "ignore_string", number_of_lines)
#search through all lines and ignore lines that contains certain stuff#or 'search1, search2' also 'ignore1, ignore2' and so ontail.isearch_lines(path_to_file, 'Search_String', 'Ignore_string', number_of_lines)
#return the last line based on the search condition#or 'search1, search2'tail.search_last_line(path_to_file, 'Search_String')
#return last line based on search and ignore conditions#or 'search1, search2' also 'ignore1, ignore2' and so ontail.isearch_last_line(path_to_file, 'Search_String', 'Ignore_String')
#parse line by linelines=tail.lines(path_to_file, number_of_lines)
[tail.parse_line(lines, "begin_delimiter", "end_delimiter") forlineinlines]

About

A high-performance Python extension module written in Rust for efficient log analysis. Implements memory-safe reverse file traversal (tail) and multi-threaded line searching using PyO3, optimized for parsing massive text files with minimal memory overhead

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages