# Logstash Configuration - filepath from remote machine

**URL:** <https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461>\
**Category:** Logstash\
**Created:** [May 18, 2018, 10:11am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461 "2018-05-18T10:11:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunillinus](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sunillinus](https://discuss.elastic.co/u/Sunillinus)\
**Post date:** [May 18, 2018, 10:11am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/1 "2018-05-18T10:11:47Z")

</div>

Hi,

My logstash configuration file contents is shown below:

input {  
file {  
path =\> ["D:/Sample/\*"]  
start\_position =\> "beginning"   
sincedb\_path =\> "/dev/null"  
}  
}

output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "Testing-%{+YYYY.MM.dd}"  
}  
stdout {}  
}

I have some log files in this path "D:\Sample\Logs\*.log" which is in remote server \10._._.\*.  
And it needs credentials like some username and password.

So I want to upload those files from my machine.  
Can anyone please tell me how should I configure input plugin, so that logstash should take logs from remote server and upload it into kibana.

---

<div class="post-metadata">

**Author:** ![arkady\_renko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arkady_renko/32/30160_2.png) [@arkady\_renko](https://discuss.elastic.co/u/arkady_renko)\
**Post date:** [May 18, 2018, 1:05pm UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/2 "2018-05-18T13:05:04Z")

</div>

I think installing filebeat on remote server and send logs to logstash is better solution for your case.

---

<div class="post-metadata">

**Author:** ![Sunillinus](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sunillinus](https://discuss.elastic.co/u/Sunillinus)\
**Post date:** [May 21, 2018, 4:54am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/3 "2018-05-21T04:54:18Z")

</div>

Hi @arkady_renko,

Can you please tell me how can i achieve that. I have installed filebeat on remote machine.  
How to send logs from filebeat to logstash?

---

<div class="post-metadata">

**Author:** ![nikhil.k](https://avatars.discourse-cdn.com/v4/letter/n/5daacb/32.png) [@nikhil.k](https://discuss.elastic.co/u/nikhil.k)\
**Post date:** [May 21, 2018, 5:43am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/4 "2018-05-21T05:43:43Z")

</div>

Hi @Sunillinus,

Please follow the given steps to transfer logs to elastic search:-

1. Refer to the link:- [Logstash(5.4.3) fails to transfer logs even when logstash starts as a service](https://discuss.elastic.co/t/logstash-5-4-3-fails-to-transfer-logs-even-when-logstash-starts-as-a-service/130093)
2. Use the below logstash.conf file for sending logs from logstash to elasticsearch  
input {  
file {  
path =\> ["/var/log/_.log", "/var/log/messages", "/var/log/syslog","/var/log/_.log"] #mention path of any file  
tags=\> [""] #mention the tag here e.g. tags=\> ["sunil"]  
}  
}

output {  
elasticsearch {  
hosts =\> "10.0.x.x" #mention the elasticsearch ip address here  
manage\_template =\> false  
index =\> "Testing-%{+YYYY.MM.dd}"  
}  
}  
3) Save the file and exit.  
4) Start the logstash

Note: Here, logs are transferred to elasticsearch without using filebeat. As, logs can be transferred to elasticsearch by simply using logstash only.

@Sunillinus let me know if you face any issues

Thanks  
Nikhil Kapoor

---

<div class="post-metadata">

**Author:** ![Sunillinus](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sunillinus](https://discuss.elastic.co/u/Sunillinus)\
**Post date:** [May 21, 2018, 6:16am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/5 "2018-05-21T06:16:26Z")

</div>

Hi @nikhil.k

Whatever you suggested is working for me. But my question is how to get the logs which are available in remote machine (some different server).

How to get filepath which is available in different machine?

---

<div class="post-metadata">

**Author:** ![arkady\_renko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arkady_renko/32/30160_2.png) [@arkady\_renko](https://discuss.elastic.co/u/arkady_renko)\
**Post date:** [May 21, 2018, 6:24am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/6 "2018-05-21T06:24:13Z")

</div>

Set logstash as output for filebeat installed on remove server.  
[https://www.elastic.co/guide/en/beats/filebeat/current/config-filebeat-logstash.html](https://www.elastic.co/guide/en/beats/filebeat/current/config-filebeat-logstash.html)

---

<div class="post-metadata">

**Author:** ![nikhil.k](https://avatars.discourse-cdn.com/v4/letter/n/5daacb/32.png) [@nikhil.k](https://discuss.elastic.co/u/nikhil.k)\
**Post date:** [May 21, 2018, 9:21am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/7 "2018-05-21T09:21:32Z")

</div>

Hi @Sunillinus,

> [@Sunillinus](#):
>
> Whatever you suggested is working for me. But my question is how to get the logs which are available in remote machine (some different server).
> 
> How to get filepath which is available in different machine?

In this case you need to install filebeat on the remote machine.

Steps to install filebeat:-

1. curl -L -O [https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.4-x86\_64.rpm](https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.4-x86_64.rpm)#please change the version if needed, as i was not knowing your logstash version
2. sudo yum install filebeat-6.2.4-x86\_64.rpm
3. Make changes in the vim /etc/filebeat/filebeat.yml file as follows:-

a)

- input\_type: log

b)  
#----------------------------- Logstash output --------------------------------  
output.logstash:  
**# The Logstash hosts**  
hosts: ["10.0.x.x:5044"] # ip address of the logstash

1. Save and exit the file
2. firewall-cmd --permanent --zone=public --add-port=5044/tcp
3. systemctl enable filebeat.service
4. systemctl start filebeat.service
5. systemctl status filebeat.service #filebeat should have been started

Now you need to configure the logstash in order to recieve the logs from filebeat

1. Open logstash.conf and enter the below given configuration  
input{  
beats {  
port =\> 5044  
}  
}

2. Save and exit the file

3. firewall-cmd --permanent --zone=public --add-port=5044/tcp

4. Start logstash

Here, "xyz.log" from filebeat(remote server) will be transferred to logstash in a file(of given path in logstash.conf)

@Sunillinus let me know if you face any issue.

Regards  
Nikhil Kapoor

---

<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:** [June 18, 2018, 9:21am UTC](https://discuss.elastic.co/t/logstash-configuration-filepath-from-remote-machine/132461/8 "2018-06-18T09:21:33Z")

</div>

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