
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
python-elastic-logstash
Advanced tools
Logstash dynamically ingests, transforms, and ships your data regardless of format or complexity. Derive structure from unstructured data with grok, decipher geo coordinates from IP addresses, anonymize or exclude sensitive fields, and ease overall processing.
Using pip::
pip install python-elastic-logstash
If any issues please submit issues in https://github.com/washim/python-elastic-logstash/issues
For example::
import logging import sys from python_elastic_logstash import ElasticHandler, ElasticFormatter
""" Provide logger name simple without any special character Logger name will become as Elastic Search Index """ logger = logging.getLogger('python-elastic-logstash') logger.setLevel(logging.DEBUG)
elasticsearch_endpoint = 'http://localhost:9200' # No trailing slash
elastic_handler = ElasticHandler(elasticsearch_endpoint, 'dev') # Second argument is optional elastic_handler.setFormatter(ElasticFormatter())
logger.addHandler(elastic_handler)
extra = { 'elastic_fields': { 'version': 'python version: ' + repr(sys.version_info) } }
logger.debug("Python elastic logstash configured", extra=extra)
.. image:: https://raw.githubusercontent.com/washim/python-elastic-logstash/master/index.png :width: 780 :align: center
.. image:: https://raw.githubusercontent.com/washim/python-elastic-logstash/master/discover.png :width: 780 :align: center
Modify your settings.py
Example::
LOGGING = { ... 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'elastic_handler': { 'level': 'DEBUG', 'class': 'python_elastic_logstash.ElasticHandler', 'url': 'http://localhost:9200' }, 'console': { 'class': 'logging.StreamHandler' }, }, 'root': { 'handlers': ['console'], 'level': 'WARNING', }, 'loggers': { 'django.request': { 'handlers': ['elastic_handler'], 'level': 'DEBUG', 'propagate': True, }, 'python-elastic-logstash': { 'handlers': ['elastic_handler'], 'level': 'DEBUG', 'propagate': True, }, } ... }
FAQs
Python logging handler for elastic search.
We found that python-elastic-logstash 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
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.