# Logstash Data Parsing Problem

**URL:** https://discuss.elastic.co/t/logstash-data-parsing-problem/213704
**Category:** Kibana
**Created:** [January 3, 2020, 12:39pm UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704 "2020-01-03T12:39:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [January 3, 2020, 12:39pm UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/1 "2020-01-03T12:39:21Z")

</div>

I have parse data through logstash i have 3 records in sql server the data is parse it shows

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/e/4e3fa51b294e555a13ab2f1269f24d37c067e5dc.png) if you look the attached image it shows 24 records and logstash shutdown after parsing data from database is there any way to logstash not shutdown and i insert record in sql and new record is showing in kibana?? and why it shows 24 records instead of 3 records

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 3, 2020, 3:44pm UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/2 "2020-01-03T15:44:52Z")

</div>

syad, more information is required.

I think you trying to ask two different question here correct?

you said you have 3 record in sql database?  
but you see 24 record? if that is the case then you have run your logstash 8 time and everytime it duplicated the records 8x3 = 24

you have to use schecule =\> in your input section and then it will not shutdown your logstash and will run it on x interval.

put your config file example, put your data input example and we should be able to tell you more.

---

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [January 6, 2020, 4:32am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/3 "2020-01-06T04:32:23Z")

</div>

this is my config file  
input {  
jdbc {  
# SqlServer jdbc connection string to our database, employeedb  
# "jdbc:sqlserver://HostName\instanceName;database=DBName;user=UserName;password=Password"  
jdbc\_connection\_string =\> "jdbc:sqlserver://localhost:1433;database=i3insight;user= **;password=**"  
# The user we want to execute our statement as  
#sincedb\_path =\> "NUL"  
jdbc\_user =\> nil  
# The path to our downloaded jdbc driver  
jdbc\_driver\_library =\> "C:/Program Files/sqljdbc\_6.2/enu/jre8/sqljdbc4-2.0.jar"  
# The name of the driver class for SqlServer  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
# Query for testing purpose  
statement =\> "SELECT \* from [i3insight].[dbo].[mcb]"  
}  
}

# filter {

# date {

# match =\> ["date", "yyyy-MM-dd HH:mm:ss.SSS a"]

# target =\> "date"

#}  
#}  
output {  
#stdout { codec =\> json\_lines }  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "connect"  
}  
stdout { codec =\> json\_lines }  
}  
now the problem is that when the data is parse in logstash through sql server when 2 records update logstash shutdown automatically and in logstash 2 records is parsed but when i open elasticsearch it shows 4 records or 8 records everytime i change the index name and run it fisrt time but still it shows 4 or 8 records

---

<div class="post-metadata">

### Author: ![mancharagopan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mancharagopan/32/60266_2.png) [@mancharagopan](https://discuss.elastic.co/u/mancharagopan)
#### Post date: [January 6, 2020, 4:58am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/4 "2020-01-06T04:58:32Z")

</div>

what version you are using?  
Go to discover and find out how many events you have there.

---

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [January 6, 2020, 5:07am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/5 "2020-01-06T05:07:02Z")

</div>

i am using 7.3.2 version

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 6, 2020, 5:53pm UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/6 "2020-01-06T17:53:06Z")

</div>

can you run a query in sqlserver and see how many records are there? is it 2 or 4?

elasticsearch will create duplicate record everytime you run your query.

for example you have two record

1. 

custname: foo  
clientname: bar

1. 

custname:abc  
clientname:def

elasticsearch will enter this record with some doument\_id

when you run it again. it will create new id for both record and enter it

---

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [January 7, 2020, 4:19am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/7 "2020-01-07T04:19:28Z")

</div>

when i run query in sql server it shows 2 records when logstash parse the data it show 2 records parse when i see in kibana it shows 4 records

---

<div class="post-metadata">

### Author: ![Syed.Ubaid](https://avatars.discourse-cdn.com/v4/letter/s/df705f/32.png) [@Syed.Ubaid](https://discuss.elastic.co/u/Syed.Ubaid)
#### Post date: [January 7, 2020, 5:34am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/8 "2020-01-07T05:34:45Z")

</div>

issue resolved for duplication. can someone tell me when parsing data from logstash is there way around that logstash service will not shutdown

---

<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: [February 4, 2020, 5:34am UTC](https://discuss.elastic.co/t/logstash-data-parsing-problem/213704/9 "2020-02-04T05:34:46Z")

</div>

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