# How to Send logstash logs directly to elastic?

**URL:** <https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488>\
**Category:** Logstash\
**Created:** [April 3, 2018, 2:05am UTC](https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488 "2018-04-03T02:05:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [April 3, 2018, 2:05am UTC](https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488/1 "2018-04-03T02:05:45Z")

</div>

Hi all

Can we send logstash logs directly to elastic?.  
Currently it sits under logs folder as physical .log files

Is there any way we can do so?

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [April 3, 2018, 5:13am UTC](https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488/2 "2018-04-03T05:13:05Z")

</div>

Hi @rkhapre,

Yes you can send logs directly to in elasticsearch using logstash configuration file you need to create one config file for send the data into elasticsearch

following is an example:  
test.conf:

input  
{  
file  
{  
path =\> "/usr/share/logstash/bin/file.log" #Your Log File Path  
}  
}

output  
{  
elassticsearch  
{  
hosts =\> ["YOUR ELASTICSEARCH IP:9200"]  
index =\> "test"  
}  
stdout{}  
}

if you are using x-pack in Elastic Stack then you have to mention in this elasticsearch{ user =\> username and password =\> password}.

then run this using ./logstash -f test.conf

Thanks & Regards,  
Krunal.

---

<div class="post-metadata">

**Author:** ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)\
**Post date:** [April 3, 2018, 6:24am UTC](https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488/3 "2018-04-03T06:24:30Z")

</div>

Hi,

As i mentioned, i need to send this directly to ES

With your conf file, first i am flushing the log files physically to a log folder and then streaming it to ES.

I am looking for solution wherein , i dont output the log file, but the logs should stream directly to ES. This i want to do, to avoid unnecessary Disk Space

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 1, 2018, 6:24am UTC](https://discuss.elastic.co/t/how-to-send-logstash-logs-directly-to-elastic/126488/4 "2018-05-01T06:24:43Z")

</div>

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