0

I am trying to pass a null value to keystore. Logstash is not working and I am getting an error. Same configuration is working if it is not stored in a keystore and hard coded "". Error :

"Unable to configure plugins: Error while trying to retrieve secret urn:logstash㊙️v1:pos"

Version: 7.4.2 Operating System: Windows 10 This is the config file : input { file { path => "${path}" start_position => "${pos}" } } path and pos are already added in keystore. Does logstash-keystore can't have blank value. Is there any work-around to handle the issue ? Can we give a default value with keystore keys ?

  • Why do you need a blank value in the keystore ? for the start position? Just input `0` instead of blank and that should work – Val May 13 '20 at 14:54
  • Welcome to SO, please refer to this for better presenting your question/answer: https://meta.stackoverflow.com/a/251362/3519504 – Sandeep Kumar May 13 '20 at 16:44

1 Answers1

0

I guess the reason you want to input a blank value in the keystore is because you want to start at the beginning (i.e. start_position => 0). If that's the case, you have two solutions:

A. Set 0 as the value of pos in the keystore instead of blank

B. Simply remove the pos key from the keystore and use a default value in the configuration

start_position => "${pos:0}"
Val
  • 207,596
  • 13
  • 358
  • 360
  • pos = "" works fine but if same thing is attempted with keystore it fails. Also path,pos is just an example. – user2831322 May 13 '20 at 17:10
  • Again, simply remove the value from the keystore and specify a default value in the configuration – Val May 15 '20 at 06:20
  • I wanted to use keystore for security purpose as I am not sure if it's gonna be blank or it will contain some value. I can't use plain text. – user2831322 May 17 '20 at 19:31
  • And you can still do that... just use a default value as shown in my answer – Val May 17 '20 at 19:39