Skip to main content

Rust tail implementation

Project description

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

Usage

import tail

path_to_file = 'path/to/file/thefile.log'
number_of_lines = 3

#return 3 lines
tail.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 on
tail.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 on
tail.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 on
tail.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 on
tail.isearch_last_line(path_to_file, 'Search_String', 'Ignore_String')

#parse line by line
lines = tail.lines(path_to_file, number_of_lines)
[tail.parse_line(lines, "begin_delimiter", "end_delimiter") for line in lines]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parse_log-1.0.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (187.9 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

File details

Details for the file parse_log-1.0.1.tar.gz.

File metadata

  • Download URL: parse_log-1.0.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.0-beta.7

File hashes

Hashes for parse_log-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ae019afe8bc5147288ab93265333a58059d642dd79c3cde2a11757b226c368dd
MD5 ac20dd527c389f7a2fbd225e1e2d2e28
BLAKE2b-256 e3eb656d964ca66a80359baef7e3b6127a8b1a47410cee89c9451f91829d51cc

See more details on using hashes here.

File details

Details for the file parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for parse_log-1.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 fda754a30ed9616d0e07c28605c75c209746258e8bc7c575e83c179ace1459ce
MD5 1f0620029752982872c9ea8a405a2893
BLAKE2b-256 82f62892de1df01629a217bc21ded9b3a52150bed212940ed2d87fa1a923322e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page