Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Async python logging handlers that send messages in the Graylog Extended Log Format (GELF).
Async python logging handlers that send messages in the Graylog Extended Log Format (GELF).
pip install asyncgelf
import asyncio
import asyncgelf
async def main(message):
handler = asyncgelf.GelfTcp(
host='127.0.0.1',
)
await handler.tcp_handler(message)
asyncio.run(main(message))
import asyncio
import asyncgelf
from datetime import datetime
async def main(message):
handler = asyncgelf.GelfTcp(
host='127.0.0.1',
)
event_time = "2024-02-06 08:25:56.789"
timeformat = "%Y-%m-%d %H:%M:%S.%f"
await handler.tcp_handler(message, datetime.strptime(event_time, timeformat).timestamp())
asyncio.run(main(message))
import asyncio
import asyncgelf
async def main(message):
handler = asyncgelf.GelfHttp(
host='127.0.0.1',
)
await handler.http_handler(message)
asyncio.run(main(message))
import asyncio
import asyncgelf
async def main(message):
handler = asyncgelf.GelfUdp(
host='127.0.0.1',
)
await handler.udp_handler(message)
asyncio.run(main(message))
Expect Dict with the following moments:
_id
can't be an additional field;import asyncio
import asyncgelf
async def main(message):
additional_field = {
'_key_1': 'value_1',
'_key_2': 'value_2',
}
handler = asyncgelf.GelfTcp(
host='127.0.0.1',
additional_field=additional_field
)
await handler.tcp_handler(message)
asyncio.run(main(message))
host
Required | Graylog server address;port
Optional | Graylog input port (default: 12201);gelf_version
Optional | GELF spec version (default: 1.1)level
Optional | The level equals to the standard syslog levels (default: 1);scheme
Optional | HTTP Scheme for GELF HTTP input only (default: http);tls
Optional | Path to custom (self-signed) certificate in pem format (default: None)compress
Optional | Compress message before sending it to the server or not (default: False)compress_level
Optional | Set compression level: available from 1 (BEST_SPEED) to 9 (BEST_COMPRESSION) (default: 1)debug
Optional | Additional information in error log (default: False)additional_field
Optional | Dictionary with additional fields which will be added to every gelf message (default: None)dns_resolve
Optional | Variable host will be checked to existing DNS as parameter and if dns is found, then on initialization will resolve to ip and variable will be updated. By default, UDP handler gets resolved by DNS on every log message. See more: #91305 (default: False)FAQs
Async python logging handlers that send messages in the Graylog Extended Log Format (GELF).
We found that asyncgelf 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.