Skip to content

Commit

Permalink
Update version: 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dogoncouch committed Apr 1, 2017
1 parent 51d0f73 commit b693aa5
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 9 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Change log
Change log for [logdissect](https://github.com/dogoncouch/logdissect)

## [1.2.1] - 2017-04-01
### Fixed
- 'syslog' parser: typo (s/Oce/Oct/)
- 'setup.py': Changed long_description to rst formatted docstring

## [1.2] - 2017-03-31
#### Added
### Added
- 'rgrep' morpher: reverse grep
- 'outjson' output module for JSON
- 'injson' parser module for JSON
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# logdissect
logdissect is a tool for gaining insight into syslog files. It can merge multiple log files together and sort by timestamp, and filter the results by time range and other criteria. Results are output to the terminal by default, and can also be output to standard syslog format, or to a JSON array. Files that end in .gz or .bz2 are ignored.
logdissect is a tool for analyzing syslog files. It can merge entries from multiple log files and sort by timestamp, and filter the results by time range and other criteria. Results are output to the terminal by default, and can also be output to standard syslog file format, or to a JSON array.

# Installing
See the latest instructions on the [releases page](https://github.com/dogoncouch/logdissect/releases).
Expand Down Expand Up @@ -47,7 +47,9 @@ See the latest instructions on the [releases page](https://github.com/dogoncouch

3. --range shortcuts: The range module will fill in your ranges with zeroes if they are shorter than 14 characters. If you want to get a range of 20170204120000 to 20170204130000, you can save time and use 2017020412 and 2017020413.

4. --last options: the last option should be a number followed by either 's' for seconds, 'm' for minutes, 'h' for hours, or 'd' for days (e.g. --last=20m).
4. --last options: The last option should be a number followed by either 's' for seconds, 'm' for minutes, 'h' for hours, or 'd' for days (e.g. --last=20m).

5. Zipped files: Files that end in .gz, .bz2, or .zip are ignored.

# Author
Dan Persons ([email protected])
Expand Down
2 changes: 2 additions & 0 deletions doc/logdissect.1
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ logdissect - Parse and merge log entries, and filter by date and other criteria.

4. --last options: the last option should be a number followed by either 's' for seconds, 'm' for minutes, 'h' for hours, or 'd' for days (e.g. --last=20m).

5. Zipped files: Files that end in .gz, .bz2, or .zip are ignored.

.SH FILES
/usr/share/doc/logdissect/README.md
/usr/share/doc/logdissect/CHANGELOG
Expand Down
2 changes: 1 addition & 1 deletion logdissect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '1.2'
__version__ = '1.2.1'
__author__ = 'Dan Persons <[email protected]>'
__license__ = 'MIT License'
__github__ = 'https://github.com/dogoncouch/logdissect'
Expand Down
3 changes: 2 additions & 1 deletion logdissect/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def load_inputs(self):
for f in self.args:
if os.path.isfile(str(f)):
fparts = str(f).split('.')
if fparts[-1] == 'gz' or fparts[-1] == 'bz2':
if fparts[-1] == 'gz' or fparts[-1] == 'bz2' or \
fparts[-1] == 'zip':
return 0
else:
fullpath = os.path.abspath(str(f))
Expand Down
2 changes: 1 addition & 1 deletion logdissect/parsers/syslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def parse_log(self, data):
months = {'Jan':'01', 'Feb':'02', 'Mar':'03', \
'Apr':'04', 'May':'05', 'Jun':'06', \
'Jul':'07', 'Aug':'08', 'Sep':'09', \
'Oce':'10', 'Nov':'11', 'Dec':'12'}
'Oct':'10', 'Nov':'11', 'Dec':'12'}
int_month = months[attr_list[0]]
daydate = str(attr_list[1]).strip().zfill(2)
timelist = str(str(attr_list[2]).replace(':',''))
Expand Down
46 changes: 44 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,48 @@
#_LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#_OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
#_SOFTWARE.
"""
Logdissect
-----
Logdissect is a tool for analyzing syslog files. It can merge entries from multiple log files and sort by timestamp, and filter the results by time range and other criteria. Results are output to the terminal by default, and can also be output to standard syslog file, or to a JSON array.
Options
```````
::
Usage: logdissect [options] <files>
--version show program's version number and exit
-h, --help show this help message and exit
--list-parsers returns a list of available parsers
--list-morphers returns a list of available morphers
--list-outputs returns a list of available output formats
-p PARSER specifies parser to use (default: syslog)
-s silences terminal output
-v sets verbose terminal output
Morph options:
--grep=PATTERN specifies a pattern to match
--host=HOST specifies a source host to match
--last=LAST specifies preceeding time period (5m/3h/2d/etc)
--process=PROCESS specifies a source process to match
--range=RANGE specifies the range <YYYYMMDDhhmm-YYYYMMDDhhmm>
--rgrep=RPATTERN specifies a pattern to filter out
Output options:
--outlog=OUTLOG sets the output file for standard log output
--label=LABEL sets label type for entries in OUTLOG <fname|fpath>
--outjson=OUTJSON sets the output file for JSON output
Links
`````
* `Releases <https://github.com/dogoncouch/logdissect/releases/>`_
* `README <https://github.com/dogoncouch/logdissect/blob/master/README.md>`_
* `Development source <https://github.com/dogoncouch/logdissect/>`_
"""

from setuptools import setup
from os.path import join
Expand All @@ -31,10 +73,10 @@

setup(name = 'logdissect', version = str(__version__),
description = 'Parse, merge, and filter syslog files',
long_description = open('README.md').read(),
long_description = __doc__,
author = 'Dan Persons', author_email = '[email protected]',
url = 'https://github.com/dogoncouch/logdissect',
download_url = 'https://github.com/dogoncouch/logdissect/archive/v1.2.tar.gz',
download_url = 'https://github.com/dogoncouch/logdissect/archive/v' + str(__version__) + '.tar.gz',
keywords = ['log', 'syslog', 'analysis', 'forensics', 'security',
'cli', 'secops', 'sysadmin', 'forensic-analysis',
'log-analysis', 'log-analyzer', 'log-viewer'],
Expand Down
2 changes: 1 addition & 1 deletion tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ diff devtests/files/diffresults.log devtests/files/diffexresults

echo
echo - There should be no errors.
echo - Times should be below 0m0.300s on an i3.
echo - Times should be around 0m0.300s on an i3.
echo - Diff results should be empty.

0 comments on commit b693aa5

Please sign in to comment.