# Event stopped process

**URL:** <https://discuss.elastic.co/t/event-stopped-process/182891>\
**Category:** Beats\
**Tags:** auditbeat\
**Created:** [May 27, 2019, 10:56am UTC](https://discuss.elastic.co/t/event-stopped-process/182891 "2019-05-27T10:56:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![holiveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/holiveira/32/100472_2.png) [@holiveira](https://discuss.elastic.co/u/holiveira)\
**Post date:** [May 27, 2019, 10:56am UTC](https://discuss.elastic.co/t/event-stopped-process/182891/1 "2019-05-27T10:56:02Z")

</div>

how to capture the status of the process when it is interrupted? I only have the status when it is running and sometimes I get a process status that has stopped.

Auditbeat 7.1.0 (Windows Server 2008 R2)  
Elasticsearch 7.0.0 (Ubuntu Server 18.04 LTS)

---

<div class="post-metadata">

**Author:** ![cwurm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cwurm/32/34882_2.png) [@cwurm](https://discuss.elastic.co/u/cwurm)\
**Post date:** [June 3, 2019, 7:50pm UTC](https://discuss.elastic.co/t/event-stopped-process/182891/2 "2019-06-03T19:50:36Z")

</div>

Hi @holiveira - by "interrupted" do you mean stopped? The Auditbeat `system/process` dataset reports stopped processes (likely what you are seeing as a stopped process status - it's an event with `event.action: process_stopped`).

Can you post an example of a process start that does not have a corresponding process stop but you think it should? And provide your configuration as well?

---

<div class="post-metadata">

**Author:** ![holiveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/holiveira/32/100472_2.png) [@holiveira](https://discuss.elastic.co/u/holiveira)\
**Post date:** [June 4, 2019, 11:42am UTC](https://discuss.elastic.co/t/event-stopped-process/182891/3 "2019-06-04T11:42:52Z")

</div>

Hi @cwurm, yes I mean, stopped.

Configuration:

```
- module: system
  datasets:
    - process # Started and stopped processes
  state.period: 5s

processors:
- drop_event:
    when:
      not:
        regexp:
          process.name: "notepad.*" 

```

I am monitoring only one process, in this case notepad.exe, in my understanding, when opening the notepad, should receive a `process_started` and in the course of time while the running process is receiving `existing_process` and when to stop the process receive the `process_stopped`.

What I've noticed is that `existing_process` occurs perfectly, but the `process_started` and `process_stopped` events do not occur.

I made a simulation, follows logs:

Auditbeat:

> <https://gist.github.com/holiiveira/3ee5b6e97f496ba26ab5d0ec2dd4a428>

In this example, my logstash processed 3 documents:

```
 "event": {
      "action": "existing_process",
      "dataset": "process",
      "id": "ebe2f666-09f0-42a8-9077-be59fa8d81d8",
      "module": "system",
      "kind": "state"
    }

"event": {
      "module": "system",
      "dataset": "process",
      "action": "existing_process",
      "id": "76f10fdd-5d5d-4aa8-bab4-06b490574dfe",
      "kind": "state"
    }

 "event": {
      "kind": "state",
      "dataset": "process",
      "action": "existing_process",
      "id": "88ba5d01-802d-414e-bc67-b66465e9033c",
      "module": "system"
    }

```

There was no `process_started` and no `process_stopped`.

---

<div class="post-metadata">

**Author:** ![cwurm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cwurm/32/34882_2.png) [@cwurm](https://discuss.elastic.co/u/cwurm)\
**Post date:** [June 4, 2019, 4:08pm UTC](https://discuss.elastic.co/t/event-stopped-process/182891/4 "2019-06-04T16:08:56Z")

</div>

Ok, I'm curious: If you increase `state.period` to something like `12h` - do you then see `process_started` and `process_stopped` events?

---

<div class="post-metadata">

**Author:** ![holiveira](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/holiveira/32/100472_2.png) [@holiveira](https://discuss.elastic.co/u/holiveira)\
**Post date:** [June 5, 2019, 12:32pm UTC](https://discuss.elastic.co/t/event-stopped-process/182891/5 "2019-06-05T12:32:11Z")

</div>

Interesting, it worked perfectly.

---

<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 26, 2019, 12:32pm UTC](https://discuss.elastic.co/t/event-stopped-process/182891/6 "2019-06-26T12:32:15Z")

</div>

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