# It's a bug?

**URL:** <https://discuss.elastic.co/t/its-a-bug/101811>\
**Category:** Beats\
**Created:** [September 26, 2017, 9:38am UTC](https://discuss.elastic.co/t/its-a-bug/101811 "2017-09-26T09:38:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![caibaoying](https://avatars.discourse-cdn.com/v4/letter/c/dc4da7/32.png) [@caibaoying](https://discuss.elastic.co/u/caibaoying)\
**Post date:** [September 26, 2017, 9:38am UTC](https://discuss.elastic.co/t/its-a-bug/101811/1 "2017-09-26T09:38:02Z")

</div>

I create a new beat based on [https://www.elastic.co/guide/en/beats/devguide/current/beater-interface.html](https://www.elastic.co/guide/en/beats/devguide/current/beater-interface.html). And then I modified beat.yml as follow, but when it is executed for 10 minutes, `/tmp/testbeats/testbeats` will no longer add data. And after a few minutes, it had increased again. So period is not 1s. What is the reason？It's a bug? What should I do?

respect

```auto
func (bt *Countbeat) Run(b *beat.Beat) error {
        logp.Info("countbeat is running! Hit CTRL-C to stop it.")

        bt.client = b.Publisher.Connect()
        ticker := time.NewTicker(bt.config.Period)
        counter := 1
        for {
                select {
                case <-bt.done:
                        return nil
                case <-ticker.C:
                }

                event := common.MapStr{ 
                        "@timestamp": common.Time(time.Now()), 
                        "type": b.Name,
                        "counter": counter,
                }
                bt.client.PublishEvent(event) 
                logp.Info("Event sent")
                counter++
        }
}

```

YML:

```auto
    testbeats:
       period: 1s # important
    output.file:
       enabled: true
  
    # Path to the directory where to save the generated files. The option is
    # mandatory.
       path: "/tmp/testbeats"
  
    # Name of the generated files. The default is `testbeats` and it generates
    # files: `testbeats`, `testbeats.1`, `testbeats.2`, etc.
       filename: testbeats
  
    # Maximum size in kilobytes of each file. When this size is reached, and on
    # every testbeats restart, the files are rotated. The default value is 10240
    # kB.
       rotate_every_kb: 10000
  
    # Maximum number of files under path. When this number of files is reached,
    # the oldest file is deleted and the rest are shifted from last to first. The
    # default is 7 files.
       number_of_files: 7

```

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [September 26, 2017, 1:40pm UTC](https://discuss.elastic.co/t/its-a-bug/101811/2 "2017-09-26T13:40:15Z")

</div>

I don't see any obvious problems with the code snippet you have shared. How are you monitoring `/tmp/testbeats/testbeats`? Perhaps the file was rotated while you were monitoring it.

Try adding some logging to your code to see if it is still running and publishing events. Then run you beat with debug enabled (add `-d "*"` to you CLI flags when starting).

---

<div class="post-metadata">

**Author:** ![caibaoying](https://avatars.discourse-cdn.com/v4/letter/c/dc4da7/32.png) [@caibaoying](https://discuss.elastic.co/u/caibaoying)\
**Post date:** [September 28, 2017, 1:21am UTC](https://discuss.elastic.co/t/its-a-bug/101811/3 "2017-09-28T01:21:11Z")

</div>

Hi, I did not make any changes to the code that was created, and I was constantly checking the size of the testbeats file on the command line,use 'ls -al' command. But the result was not what I wanted, and the file size would not change after 10 minutes of operation. After a while, period=1s loss of original meaning. I do not know why?

---

<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:** [October 17, 2017, 9:49am UTC](https://discuss.elastic.co/t/its-a-bug/101811/4 "2017-10-17T09:49:12Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
