Logstash with java

Hello, I would like to ask two questions regarding logstash.

I'm developing a project to parse text, and I'm also using Logstash and elasticSearch.

My questions are:
1- Is it possible to use Logstash from the java application?

2- If so, is it possible to do several searches at the same time? The idea is not to use several keywords, but to do a search and if you want in 1 minute to start another different. Is this possible?

greetings

Since Logstash doesn't do searches it's not clear what you mean. Are you perhaps actually asking about Elasticsearch?

1 Like

I apologize. I start elasticSearch and use the following configuration in logstash:

consumer_key => "..."
    consumer_secret => "...."
    oauth_token => "....."
    oauth_token_secret => "....."
	keywords => ["real madrid"]
	full_tweet => true
	#type  => hashtag
	#languages => "PT"
	#locations =>
	ignore_retweets => true
}
}
filter {
 
}
output {
	stdout { codec => dots }
	#stdout { codec => rubydebug }
	#stdout { codec => json }
	elasticsearch {
		hosts => "localhost:9200"
		index => "super"
		document_type => "tweet"
		template => "twitter_template.json"
		template_name => "twitter"
  }

My question is if I can start this process through Java and if I can post several processes of this search (different searches), at different times, but may be running at the same time.

Could I explain myself better, or not at all?

greetings

My question is if I can start this process through Java

Java does of course support starting other programs, so yes.

if I can post several processes of this search (different searches), at different times, but may be running at the same time.

Is it the twitter input you're calling a search? But yes, you can run more than one Logstash instance concurrently.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.