
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
universal-access-log-parser
Advanced tools
= universal-access-log-parser
== Installation
gem install universal-access-log-parser
== Usage
require 'universal-access-log-parser'
# use predefined parser
parser = UniversalAccessLogParser.apache_combined
# or extend it inline
parser = UniversalAccessLogParser.new do
# reuse predefined element set
apache_combined
# add your own
string :varnish
string :varnish_status, :nil_on => '-'
string :initial_varnish_status, :nil_on => '-'
integer :cache_hits
integer :cache_ttl, :nil_on => '-'
integer :cache_age
end
# or define new parser
UniversalAccessLogParser.parser(:iis) do
skip_line '^#'
date_iis :time
ip :server_ip
string :method
string :url
string :query, :nil_on => '-'
integer :port
string :username, :nil_on => '-'
ip :client_ip
string :user_agent, :nil_on => '-', :process => lambda{|s| s.tr('+', ' ')}
integer :status
integer :substatus
integer :win32_status
integer :duration, :process => lambda{|i| i.to_f / 1000}
end
parser = UniversalAccessLogParser.iis
# and iterate entries with #each - won't raise errors
stats = parser.parse_file('access.log').each |entry|
puts entry.time
puts entry.cache_age
end
# and get parsing stats
puts stats.failures
puts stats.successes
# or wait for exception with #each!
parser.parse_file('access.log').each! |entry|
puts entry.time
puts entry.cache_age
end # will raise UniversalAccessLogParser::ParsingError on line parsing error
# data elements wont be parsed until accessed, so if you are not interested in some elements you won't waste time
stats = parser.parse_file('access.log').each |entry|
# entry.time not parsed yet - Time object is not created
puts entry.time # this will parse time and create Time object - this may raise UniversalAccessLogParser::ElementParsingError!
puts entry.time # now Time object is returned from cache
puts entry.cache_age
# parse all elements
entry.parse!
# this will also parse all elements and return hash map of them
entry.to_hash
end
# iterate and parse all data with #each_parsed! - if this won't raise, all log lines are parsing fine including elements
parser.parse_file('access.log').each_parsed! |entry|
puts entry.time # already in cache
puts entry.cache_age # already in cache
end # will raise on line and element parsing error - try rescuing UniversalAccessLogParser::ParserError to catch both
== Contributing to universal-access-log-parser
== Copyright
Copyright (c) 2011 Jakub Pastuszek. See LICENSE.txt for further details.
FAQs
Unknown package
We found that universal-access-log-parser demonstrated a not healthy version release cadence and project activity because the last version was released 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.