# Import txt log data to cluster

**URL:** <https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611>\
**Category:** Logstash\
**Created:** [May 21, 2018, 5:03am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611 "2018-05-21T05:03:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amin1](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Amin1](https://discuss.elastic.co/u/Amin1)\
**Post date:** [May 21, 2018, 5:03am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611/1 "2018-05-21T05:03:34Z")

</div>

Hello all,  
I want to import some .TXT log to my elasticsearch cluster via Logstash.  
my logstash configuration is as follow :  
please help me how config my logstash and which filter is suitable for this job ?

## Data Format :

## date=2018-05-04 time=23:49:32 itime=1525461572 threat=ip\_src\_session threatlevel=4 threattype=ips logver=52 logid=18432 type=anomaly subtype=anomaly level=alert devid=FG600C3913802373 sessionid=0 attackid=16777322 severity=critical srcip=5.127.45.0 dstip=192.168.148.24 srcport=18137 dstport=8010 srcintf=Internet action=clear\_session proto=6 service=IntelliLAN\_8010/TCP ref=http://www.fortinet.com/ids/VID16777322 count=13 msg="anomaly: ip\_src\_session, 41 \> threshold 40, repeats 13 times" vd=root attack=ip\_src\_session crscore=50 crlevel=critical policyid=1 srccountry="Iran, Islamic Republic of" date=2018-05-04 time=23:29:58 itime=1525460399 threat=ip\_src\_session threatlevel=4 threattype=ips logver=52 logid=18432 type=anomaly subtype=anomaly level=alert devid=FG600C3913802373 sessionid=0 attackid=16777322 severity=critical srcip=5.123.168.194 dstip=192.168.148.8 srcport=19934 dstport=8011 srcintf=Internet action=clear\_session proto=6 service=IntelliLAN\_8011/TCP ref=http://www.fortinet.com/ids/VID16777322 count=8 msg="anomaly: ip\_src\_session, 41 \> threshold 40, repeats 8 times" vd=root attack=ip\_src\_session crscore=50 crlevel=critical policyid=1 srccountry="Iran, Islamic Republic of"

## Logstash configuration :

input {  
redis {  
host =\> "172.24.69.9"  
data\_type =\> "list"  
port =\> "6379"  
key =\> "sadra"  
}

redis {  
host =\> "172.24.69.10"  
data\_type =\> "list"  
port=\> "6379"  
key =\> "sadra"  
}  
}

filter {  
kv { }  
}

output {

elasticsearch {  
hosts =\> ["172.24.69.21:9200","172.24.69.14:9200"]  
index =\> "pasdaranlog-%{+xxxx.ww}"  
user =\> \*\*\*\*\*  
password =\> \*\*\*\*\*\*\*

## } }

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 21, 2018, 5:58am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611/2 "2018-05-21T05:58:34Z")

</div>

Using the KV filter makes sense, what problems are you having?

---

<div class="post-metadata">

**Author:** ![Amin1](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Amin1](https://discuss.elastic.co/u/Amin1)\
**Post date:** [May 21, 2018, 6:53am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611/3 "2018-05-21T06:53:08Z")

</div>

hello  
how import log from file ?  
best

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 21, 2018, 7:23am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611/4 "2018-05-21T07:23:14Z")

</div>

Use the file input and you should be good.

---

<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, 7:23am UTC](https://discuss.elastic.co/t/import-txt-log-data-to-cluster/132611/5 "2018-06-18T07:23:33Z")

</div>

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