Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Get lines from a number of log files with different time-stamp formats in chronological order
Mingle is a library and command line tool to allow you to read from many log files, line by line in chronological order.
Mingle uses the python-dateutil module to flexibly attempt to parse the first part of each line as a datetime, and provides a generator to access the lines in total chronological order, across the input files.
It also offers a function to conveniently print the lines out in chronological order, optionally marking which files the lines come from.
A command line utility 'mingle' is also provided, to print the log file lines in chronological order from the shell.
To access a generator that will return lines from multiple log files in chronological order::
>>> from mingle import mingled
>>> files = ['webserver-log', 'db-log', 'firewall-log']
>>> for line, filename in mingled(files):
>>> print("The line: " + line)
>>> print("From file:" + filename)
To conveniently print the lines to stdout::
>>> import mingle
>>> files = ['webserver-log', 'db-log', 'firewall-log']
>>> mingle.cat(files)
To print the usage of the command line interface::
user@localhost:~$ mingle -h
usage: mingle [-h] [-q] files [files ...]
Inter-mingle the contents of several log files by date stamp.
positional arguments:
files the files to intermingle
optional arguments:
-h, --help show this help message and exit
-q, --quiet strip the filename annotations from the output
FAQs
Get lines from a number of log files with different time-stamp formats in chronological order
We found that mingle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.