Python-based CLI tool to convert log data to column files.
Make sure Apache Kafka is installed on your system. If not, you can follow the given link to do so.
You can follow this link for instructions on starting the Kafka environment. In summary:
Run the following commands in order to start all services in the correct order:
# Start the ZooKeeper service
bin/zookeeper-server-start.sh config/zookeeper.properties
Open another terminal session and run:
# Start the Kafka broker service
bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --create --topic log_topic --bootstrap-server localhost:9092
Make sure the topic name is log_topic
pip install kafka-python
To run the CLI tool, you can execute it from the command line like this:
python log_to_columns.py "input.log" output_columns
Replace input.log
with the path to your input log file, and output_columns
with the desired output directory.
First, ensure you have Streamlit installed. You can install it via pip:
pip install streamlit
Run the Streamlit app using the following command in the project directory:
streamlit run streamlit_app.py
This will start a local development server and open a web page with the Streamlit interface. Users can interact with the UI to perform log-to-column conversion.
When you’re done with the conversion, follow these steps to exit the Kafka environment:
- Stop the consumer and producer clients with Ctrl+C
- Stop the Kafka Server with Ctrl+C
- Run the following command to clean up:
rm -rf /tmp/kafka-logs /tmp/zookeeper /tmp/kraft-combined-logs
```# log2col