# Powershell can't start-service filebeat

**URL:** https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120
**Category:** Beats
**Tags:** filebeat
**Created:** [March 11, 2024, 6:35am UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120 "2024-03-11T06:35:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Zidane](https://avatars.discourse-cdn.com/v4/letter/z/58956e/32.png) [@Zidane](https://discuss.elastic.co/u/Zidane)
#### Post date: [March 11, 2024, 6:35am UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120/1 "2024-03-11T06:35:42Z")

</div>

hello,

I had a problem, after I change es's password which used keystore value, the service can't run like this...

my filebeat.yml

```auto
variables:
  app_type: "API"
  logging_ip: "10.111.244.62"
filebeat.config:
  inputs:
    enabled: true
    path: ${path.config}/inputs.d/*.yml
processors:
  - decode_json_fields:
      fields: ["message"]
      process_array: false
      max_depth: 1
      target: ""
      overwrite_keys: true
      add_error_key: true
  - timestamp:
      field: logtime
      ignore_missing: false
      ignore_failure: false
      layouts:
        - "2006-01-02T15:04:05Z"
        - "2006-01-02T15:04:05.999Z"
        - "2006-01-02T15:04:05.999-07:00"
        - "2006-01-02T15:04:05.1234567-07:00"
  - drop_fields:
      fields: [logtime]
logging.level: debug
logging.to_files: true
logging.files:
  path: C:\SYSlog\Filebeat
  name: filebeat
  keepfiles: 7
  permissions: 0644
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
setup.template.settings:
  index.number_of_shards: 1
setup.template.name: "filebeat-%{[agent.version]}"
setup.template.pattern: "filebeat-%{[agent.version]}"
output.elasticsearch:
  hosts: ["https://10.111.244.64:9200"]  
  ssl: 
    verification_mode: none  
  index: "filebeat-%{[agent.version]}-${variables.app_type}-%{+yyyy.MM.dd}"
  username: elastic
  password: ${elasticpw}

```

had error

```auto
PS C:\Program Files\Filebeat> start-service filebeat
start-service : Service 'filebeat (filebeat)' cannot be started due to the following error: Cannot start service filebeat on computer '.'.
At line:1 char:1
+ start-service filebeat
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

PS C:\Program Files\Filebeat>

```

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [March 11, 2024, 1:55pm UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120/2 "2024-03-11T13:55:45Z")

</div>

Hi @Zidane Welcome to the community.

Try to start filebeat in the foreground not as a service just to see what all the errors are

`.\filebeat.exe`

You can also try hard coding the password to make sure it works.

And then you did not show what commands you used to enter the password into the keystore.

---

<div class="post-metadata">

### Author: ![Zidane](https://avatars.discourse-cdn.com/v4/letter/z/58956e/32.png) [@Zidane](https://discuss.elastic.co/u/Zidane)
#### Post date: [March 12, 2024, 1:20am UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120/3 "2024-03-12T01:20:29Z")

</div>

my step:

- .\filebeat keystore create
- .\filebeat keystore add elasticpw  
(and enter password)

and checked it

```auto
PS C:\Program Files\Filebeat> .\filebeat keystore list
elasticpw
PS C:\Program Files\Filebeat>

```

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [March 12, 2024, 1:34am UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120/4 "2024-03-12T01:34:29Z")

</div>

Start filebeat in the foreground so you can see all the logs / errors ... Show the entire startup

---

<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: [April 9, 2024, 3:34am UTC](https://discuss.elastic.co/t/powershell-cant-start-service-filebeat/355120/5 "2024-04-09T03:34:43Z")

</div>

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