Hi, I'm trying to send data in Django sqlite DB to Elasticsearch by using Logstash.
I made two tables in Django and they are in sqlite DB basically embedded in Django. And I want send these datas to elasticsearch by using logstash, but not sure which logstash input plugin to choose...
I'm confused with two ways below.
First, the python-logstash method in Django settings.py and tcp input plugin of logstash.
Second, the sqlite input plugin of logstash.
The problem of second way is that the latest version of sqlite input plugin was in 2018, meaning elastic team doesn't support this way offcially.
I've tried the first one, but it didn't work anyway. Here is settings.py in Django I've written.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'logstash': {
'level': 'INFO',
'class': 'logstash.TCPLogstashHandler',
'host': 'localhost',
'port': 5959, # Default value: 5959
'version': 1,
'message_type': 'django',
'fqdn': False,
'tags': ['django.request'],
},
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler'
},
},
'loggers': {
'django.request': {
'handlers': ['logstash'],
'level': 'INFO',
'propagate': True,
},
'django': {
'handlers': ['console'],
'propogate': True,
},
}
}
and this is my logstash conf file. I just wanted to check whether django datas have been sent to logstash through "stdout", but there was no output.
input {
tcp {
port => 5959
codec => json
}
}
output {
stdout {
}
}
In my situation, is it right to use logstash.TCPLogstashHandler in settings.py and tcp input plugin of logstash? Or is there any other method to recommend?
Thank you.