Python based CLI for Syncing File System based Data (CSV file etc.) to Elasticsearch.
Project description
FS2Elastic
Python based CLI for Syncing File System based Data (CSV file etc.) to Elasticsearch.
Features
- Real time csv file to Elasticsearch dataset syncing
- Configurable with custom config file
Installation
pip install fs2elastic
Configuration
configuration file present at ~/.fs2elastic/fs2elastic.conf
.
- please create configuration file if not present.
- replace values with correct values
- remove configs that does not require
default configuration:
[AppConfig]
app_home = "/home/john/.fs2elastic"
app_config_file_path = "/home/john/.fs2elastic/fs2elastic.conf"
[DatasetConfig]
dataset_source_dir = "/home/john/csv_data_set"
dataset_supported_file_extensions = [ "csv", "xlsx", "xls", "json"]
dataset_max_workers = 1
dataset_threads_per_worker = 10
dataset_chunk_size = 200
[ESConfig]
es_hosts = [ "https://localhost:9200",]
es_username = "elastic"
es_password = ""
es_timeout = 300
es_index_prefix = "fs2es-"
es_ssl_ca = ""
es_verify_certs = false
[LogConfig]
log_file_path = "/home/john/.fs2elastic/fs2elastic.log"
log_max_size = 10485760
log_backup_count = 5
Usage
with Default config file
fs2elastic
with Custom config file
fs2elastic -c <config file path>
eg: fs2elastic -c ~/Documents/fs2elastic_custom_config.conf
Help
fs2elastic -h
Version
fs2elastic -v
Use as a system service
NOTE: Required sudo permission
# install Package
sudo pip install fs2elastic
# Create fs2elastic home directory somewhere. for eg /tmp/fs2elastic/
mkdir /tmp/fs2elastic/
# create config file at /tmp/fs2elastic/fs2elastic.conf inside fs2elastic home directory created above
[AppConfig]
app_home = "/home/john/.fs2elastic"
app_config_file_path = "/home/john/.fs2elastic/fs2elastic.conf"
[DatasetConfig]
dataset_source_dir = "/home/john/csv_data_set"
dataset_supported_file_extensions = [ "csv", "xlsx", "xls", "json"]
dataset_max_workers = 1
dataset_threads_per_worker = 10
dataset_chunk_size = 200
[ESConfig]
es_hosts = [ "https://localhost:9200",]
es_username = "elastic"
es_password = ""
es_timeout = 300
es_index_prefix = "fs2es-"
es_ssl_ca = ""
es_verify_certs = false
[LogConfig]
log_file_path = "/home/john/.fs2elastic/fs2elastic.log"
log_max_size = 10485760
log_backup_count = 5
# replace with correct values
# create service file at /etc/systemd/system/fs2elastic.service with following content
[Unit]
Description=FS2Elastic Service
After=network.target
[Service]
User=root
Group=root
ExecStart=/usr/bin/fs2elastic -c /tmp/fs2elastic/fs2elastic.conf
Restart=always
[Install]
WantedBy=multi-user.target
# Reloading Change to Systemd Unit Files
sudo systemctl daemon-reload
# Start service
sudo systemctl start fs2elastic
# Enable service to start on boot
sudo systemctl enable fs2elastic
# check status
sudo systemctl status fs2elastic
# check logs
sudo tail -f /var/log/fs2elastic.log
# To stop service
sudo systemctl stop fs2elastic
# To remove service
sudo systemctl disable fs2elastic
sudo rm /etc/systemd/system/fs2elastic.service
Uninstall
pip uninstall fs2elastic
Who do I talk to?
- Repo owner or admin
- Other community or team contact
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fs2elastic-0.1.1.tar.gz
(14.5 kB
view details)
Built Distribution
File details
Details for the file fs2elastic-0.1.1.tar.gz
.
File metadata
- Download URL: fs2elastic-0.1.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c52003b382ec93b20a49b41e1af1369e65705f4467926e9c5eb54df46418528 |
|
MD5 | b4cae188ba1ad4708b28199aa65c5bdf |
|
BLAKE2b-256 | b8ccac867a1b88a838ee3295ef298d36ca64a210d86e8e3973428578881db2fb |
File details
Details for the file fs2elastic-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: fs2elastic-0.1.1-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ec094f4f2e78a358f4df7fb7944ba1acccbbe83b8a968be2a724b973886f8c |
|
MD5 | 4cc958357306925c60dc18b2f52d7c44 |
|
BLAKE2b-256 | 360bf31777edd59ff8cbfd86fe2d2b6c9de9da14f2992b6f5502167ef4d331b4 |