Questions
Find answers to frequently asked development questions. For information about Better Stack products, explore our docs.
How to Parse Nested JSON Fields in Fluentd
Learn how to configure Fluentd for nested JSON parsing in log messages for enhanced structured logging
How to Fix The “Pattern Not Match” Error in Fluentd
If you're new to FluentD and looking to build a solid foundation, consider checking out our comprehensive guide on how to collect, process, and ship log data with Fluentd. It provides valuable insi...
How to Rotate Log Files in Fluentd?
Fluentd offers the capability to set up log rotation, particularly useful when managing large volumes of logs that consume significant disk space. This feature can be configured through Fluentd's s...
How to Use Conditional Statements In Fluentd
Conditional statements can be seamlessly integrated into Fluentd's record_transformer plugin. Here’s how you can do it: <filter mylogs> @type recordtransformer enableruby true <record> is...
How to Monitor a Whole Directory With Fluentd?
Fluentd provides an efficient way to monitor entire directories for log file updates. Let's say you want to track all log files in a directory like /var/log/app_dir, which contains multiple logs su...
How to exclude pattern in <match> for fluentd config?
To selectively filter log events in Fluentd, you can use the <match> directive to specify which events to process and which to discard. Here's how you can do it: To discard all events that match a ...
How to Add Tags to Fluentd Events
Here is how you can add tags to Fluentd events. Let's assume you configured Fluentd to process Nginx access logs from the access.log file with a source configuration like this: <source> @type ta...
How to Use Environmental Variables in Fluentd Config
Fluentd, starting from version v1.13.0, allows the integration of environment variables within its configuration using the syntax #{ENV['YOUR_ENV_VARIABLE']}. For instance, if you've defined an env...
How to Send Logs to Multiple Outputs With Same Match Tags in Fluentd?
To direct logs matching a specific tag to multiple outputs in Fluentd, the @type copy directive can be utilized. Here's an example configuration: <match pattern> @type copy <store> ...
How To Whitelist Better Stack IPs in UFW
Learn how to whitelist Better Stack IPs on UFW and prevent any false incident alerting.
How To Whitelist Better Stack IPs in Digital Ocean
Learn how to whitelist Better Stack IPs on Digital Ocean and prevent any false incident alerting.
How To Whitelist Better Stack IPs and User Agent in Cloudflare
Learn how to whitelist Better Stack IPs on Cloudflare and prevent any false incident alerting.
How To Write Logs To A File With Python?
If you are new to logging in Python, please feel free to start with our Introduction to Python logging to get started smoothly. Otherwise, here is how to write logs to a file in Python: Using Basic...
How To Use Logging In Multiple Modules?
It's recommended to have a logger defined in each module like this: import logging logger = logging.getLogger(name) Then in your main program, do the following: import logging.config logging.config...
How To Log Uncaught Exceptions In Python?
For this, you can use the sys.excepthook that allows us to attach a handler for any unhandled exception: Creating a logger logger = logging.getLogger(name) logging.basicConfig(filename='example.log...
How to Log to Stdout with Python?
If you are new to logging in Python, please feel free to start with our Introduction to Python logging to get started smoothly. Otherwise, here is how to log to Stdout with Python: Using Basic Conf...
How to log data as JSON with Python
How to Log Data As JSON With Python? The simplest way is to use a custom module.
How To Log All Requests From The Python Request Library?
If you are new to logging in Python, please feel free to start with our Introduction to Python logging to get started smoothly. Otherwise, here is how to log all requests from the python request li...
How To Disable Logging While Running Django Unit Tests?
By Disabling Tests At The Start Of The Application Suppose you want to do it the quick way. In that case, the following line of code will disable any log messages less severe or equal to CRITICAL: ...
How To Disable Logging From The Python Request Library?
You can change the log level of the logger taking care of these messages. Setting the level to WARNING will remove the request messages and keep warnings and errors: import logging logging.getLogge...
Make your mark
Join the writer's program
Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.
Write for usBuild on top of Better Stack
Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.
community@betterstack.comor submit a pull request and help us build better products for everyone.
See the full list of amazing projects on github
Thank you to everyone who
Here is to all the fantastic people that are contributing and sharing their amazing projects: Thank you!