I am using logstash to put my data from couchdb into elasticsearch. I just noticed that my _rev field in not ported to elasticsearch. Do I need to do something special to have that in elasticsearch. Prompt help will be appreciated.
Yes I know that. Is there anything in logstash config file that I can set so that _rev field also goes to my ES indices. I only have input and output sections in my logstash config file.
Here is my input in logstash config file:
As far as I recall, user defined fields are not allowed to start with an underscore, as this indicates an Elasticsearch internal field. Can you try renaming it in Logstash and see if that makes a difference?
@Christian_Dahlqvist, _id from couchdb documents was also put in my ES indices as id in _source field of ES index
automatically then why _rev is omitted.
Anyways I added this to my logstash config file:
filter{
mutate {
convert => { "_rev" => "rev" }
}
}
but after that none of the indices were getting created at all.
PS: _rev is a default/intrinsic field for every document in couchdb like _id.
but that also didn't put rev field in elasticserch indices.
Could it be that logstash coucdb plugin is not handing over _rev field to logstash to put it in ES indices?
It should be a very basic question for logstash/elasticsearch guys. I'll really appreciate a prompt solution as I am close to release, thanks!
If it's not in LS then either it's not coming from CB, or it is and LS is not carrying it over for some reason, or something else. You need to get visibility into the pipeline and you should start by adding {stdout {codec => rubydebug}} to the output section of your LS config, then see what is actually coming through.
From there, you can make your next move.
In stdout, I didn't see _rev field coming through. Any idea what could be the problem then?
can you please clarify if this is the default behavior of logstash/logstash couchdb plugin to omit _rev since I am not doing anything non regular to get data from couchdb.
You aren't using the keep_revision flag in your input. Sending _rev is not always desired, so it is omitted by default, unless this flat is set to true.
@theuntergeek thanks for the help.
Just want to confirm that keep_revision only includes _rev field in index or does it maintain all revisions in ES index. For example, if a document A is inserted and then updated in couchDB, would ES index has only one copy of document A with correct/latest _rev, or would it save two copies of document one with insert _rev and the 2nd with update _rev?
In other words is there any side effect of setting keep_revision to true, since its false by default?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.