# ELK stack on windows server with MSSQL db

**URL:** <https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010>\
**Category:** Logstash\
**Created:** [June 27, 2017, 6:12pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010 "2017-06-27T18:12:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:12pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/1 "2017-06-27T18:12:18Z")

</div>

Hi, dear community.  
I am new in ELK, I have task to create Kibana dashboards for data visualization on Win server(aws) and I have to use MSSQL as data source.  
I created file db.conf with content below:  
input {  
jdbc {  
jdbc\_connection\_string =\> "jdbc:sqlserver://alt.database.windows.net:1433;databaseName=\*\*\*;user=\*\*\*;password=\*\*\*;"  
jdbc\_driver\_library =\> "C:\elk\logstash-5.4.2\lib\sqljdbc41.jar"  
jdbc\_driver\_class =\> "com.microsoft.sqlserver.jdbc.SQLServerDriver"  
statement =\> "SELECT \* from rep\_mainTable"  
}  
}  
output {  
stdout { codec =\> json\_lines }  
}

then I use command:  
**C:\elk\logstash-5.4.2\bin\>logstash.bat -f ..\config\db.conf**

But unfortunately I see error message:  
Sending Logstash's logs to C:/elk/logstash-5.4.2/logs which is now configured via log4j2.properties  
[2017-06-27T15:28:48,270][FATAL][logstash.runner] An unexpected error occurred!  
{:error=\>#\<ArgumentError: Setting "" hasn't been registered\>,  
:backtrace=\>["C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:29  
:in `get_setting'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:61 :in`set\_value'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:80  
:in `merge'", "org/jruby/RubyHash.java:1342 :in`each'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:80  
:in `merge'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:129 :in`validate\_all'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/runner.rb:217  
:in `execute'", "C:/elk/logstash-5.4.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67 :in`run'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/runner.rb:185  
:in `run'", "C:/elk/logstash-5.4.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132 :in`run'", "C:\elk\logstash-5.4.2\lib\bootstrap\environment.rb:71:in `(root)'"]}

Can you please help to fix it.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 27, 2017, 6:19pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/2 "2017-06-27T18:19:24Z")

</div>

The error message is incomplete. Please paste it again but format it as preformatted text (use the `</>` toolbar button).

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:36pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/3 "2017-06-27T18:36:56Z")

</div>

oh, I am sorry

```
Sending Logstash's logs to C:/elk/logstash-5.4.2/logs which is now configured via log4j2.properties
[2017-06-27T15:28:48,270][FATAL][logstash.runner] An unexpected error occurred! {:error=>#<ArgumentError: Setting "" hasn't been registered>, :backtrace=>["C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:29:in `get_setting'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:61:in `set_value'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:80:in `merge'", "org/jruby/RubyHash.java:1342:in `each'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:80:in `merge'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/settings.rb:129:in `validate_all'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/runner.rb:217:in `execute'", "C:/elk/logstash-5.4.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "C:/elk/logstash-5.4.2/logstash-core/lib/logstash/runner.rb:185:in `run'", "C:/elk/logstash-5.4.2/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "C:\\elk\\logstash-5.4.2\\lib\\bootstrap\\environment.rb:71:in `(root)'"]}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 27, 2017, 6:42pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/4 "2017-06-27T18:42:32Z")

</div>

Have you modified config/logstash.yml? If yes, please post the contents formatted as preformatted text using the `</>` toolbar button.

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:51pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/5 "2017-06-27T18:51:33Z")

</div>

Yes. There is logstash.yml:

```
input {     
jdbc {
jdbc_connection_string => "jdbc:sqlserver://zzzz.windows.net:1433;databaseName=zzzz;user=zzzz;password=zzzz;"
jdbc_driver_library => "C:\elk\logstash-5.4.2\lib\sqljdbc41.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
statement => "SELECT * from rep_mainTable"
}
}
output {
stdout { codec => json_lines }
}
```

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 27, 2017, 6:53pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/6 "2017-06-27T18:53:13Z")

</div>

Is that really what your **config/logstash.yml** looks like? Note that I did not ask for db.conf.

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:54pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/7 "2017-06-27T18:54:43Z")

</div>

Yes, I put the same content in logstash.yml.  
I can try to return default logstash.yml and run again...

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:56pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/8 "2017-06-27T18:56:25Z")

</div>

This is logstash.yml now:

```
   # Settings file in YAML
    #
    # Settings can be specified either in hierarchical form, e.g.:
    #
    # pipeline:
    # batch:
    # size: 125
    # delay: 5
    #
    # Or as flat keys:
    #
    # pipeline.batch.size: 125
    # pipeline.batch.delay: 5
    #
    # ------------ Node identity ------------
    #
    # Use a descriptive name for the node:
    #
    # node.name: test
    #
    # If omitted the node name will default to the machine's host name
    #
    # ------------ Data path ------------------
    #
    # Which directory should be used by logstash and its plugins
    # for any persistent needs. Defaults to LOGSTASH_HOME/data
    #
    # path.data:
    #
    # ------------ Pipeline Settings --------------
    #
    # Set the number of workers that will, in parallel, execute the filters+outputs
    # stage of the pipeline.
    #
    # This defaults to the number of the host's CPU cores.
    #
    # pipeline.workers: 2
    #
    # How many workers should be used per output plugin instance
    #
    # pipeline.output.workers: 1
    #
    # How many events to retrieve from inputs before sending to filters+workers
    #
    # pipeline.batch.size: 125
    #
    # How long to wait before dispatching an undersized batch to filters+workers
    # Value is in milliseconds.
    #
    # pipeline.batch.delay: 5
    #
    # Force Logstash to exit during shutdown even if there are still inflight
    # events in memory. By default, logstash will refuse to quit until all
    # received events have been pushed to the outputs.
    #
    # WARNING: enabling this can lead to data loss during shutdown
    #
    # pipeline.unsafe_shutdown: false
    #
    # ------------ Pipeline Configuration Settings --------------
    #
    # Where to fetch the pipeline configuration for the main pipeline
    #
    # path.config:
    #
    # Pipeline configuration string for the main pipeline
    #
    # config.string:
    #
    # At startup, test if the configuration is valid and exit (dry run)
    #
    # config.test_and_exit: false
    #
    # Periodically check if the configuration has changed and reload the pipeline
    # This can also be triggered manually through the SIGHUP signal
    #
    # config.reload.automatic: false
    #
    # How often to check if the pipeline configuration has changed (in seconds)
    #
    # config.reload.interval: 3
    #
    # Show fully compiled configuration as debug log message
    # NOTE: --log.level must be 'debug'
    #
    # config.debug: false
    #
    # ------------ Queuing Settings --------------
    #
    # Internal queuing model, "memory" for legacy in-memory based queuing and
    # "persisted" for disk-based acked queueing. Defaults is memory
    #
    # queue.type: memory
    #
    # If using queue.type: persisted, the directory path where the data files will be stored.
    # Default is path.data/queue
    #
    # path.queue:
    #
    # If using queue.type: persisted, the page data files size. The queue data consists of
    # append-only data files separated into pages. Default is 250mb
    #
    # queue.page_capacity: 250mb
    #
    # If using queue.type: persisted, the maximum number of unread events in the queue.
    # Default is 0 (unlimited)
    #
    # queue.max_events: 0
    #
    # If using queue.type: persisted, the total capacity of the queue in number of bytes.
    # If you would like more unacked events to be buffered in Logstash, you can increase the
    # capacity using this setting. Please make sure your disk drive has capacity greater than
    # the size specified here. If both max_bytes and max_events are specified, Logstash will pick
    # whichever criteria is reached first
    # Default is 1024mb or 1gb
    #
    # queue.max_bytes: 1024mb
    #
    # If using queue.type: persisted, the maximum number of acked events before forcing a checkpoint
    # Default is 1024, 0 for unlimited
    #
    # queue.checkpoint.acks: 1024
    #
    # If using queue.type: persisted, the maximum number of written events before forcing a checkpoint
    # Default is 1024, 0 for unlimited
    #
    # queue.checkpoint.writes: 1024
    #
    # If using queue.type: persisted, the interval in milliseconds when a checkpoint is forced on the head page
    # Default is 1000, 0 for no periodic checkpoint.
    #
    # queue.checkpoint.interval: 1000
    #
    # ------------ Metrics Settings --------------
    #
    # Bind address for the metrics REST endpoint
    #
    # http.host: "127.0.0.1"
    #
    # Bind port for the metrics REST endpoint, this option also accept a range
    # (9600-9700) and logstash will pick up the first available ports.
    #
    # http.port: 9600-9700
    #
    # ------------ Debugging Settings --------------
    #
    # Options for log.level:
    # * fatal
    # * error
    # * warn
    # * info (default)
    # * debug
    # * trace
    #
    # log.level: info
    # path.logs:
    #
    # ------------ Other Settings --------------
    #
    # Where to find custom plugins
    # path.plugins: []
```

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 6:58pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/9 "2017-06-27T18:58:43Z")

</div>

And error message is new:

```
Sending Logstash's logs to C:/elk/logstash-5.4.2/logs which is now configured via log4j2.properties
[2017-06-27T18:53:50,949][INFO][logstash.setting.writabledirectory] Creating directory {:setting=>"path.queue", :path=>"C:/elk/logstash-5.4.2/data/queue"}
[2017-06-27T18:53:51,014][INFO][logstash.agent] No persistent UUID file found. Generating new UUID {:uuid=>"2f2ae073-ce5b-4e3a-89ce-c8b39e4ec059", :path=>"C:/elk/logstash-5.4.2/data/uuid"}
[2017-06-27T18:53:51,333][ERROR][logstash.inputs.jdbc] Missing a required setting for the jdbc input plugin:

  input {
    jdbc {
      jdbc_user => # SETTING MISSING
      ...
    }
  }
[2017-06-27T18:53:51,374][ERROR][logstash.agent] Cannot create pipeline {:reason=>"Something is wrong with your configuration."}
```

---

<div class="post-metadata">

**Author:** ![lkapustina](https://avatars.discourse-cdn.com/v4/letter/l/edb3f5/32.png) [@lkapustina](https://discuss.elastic.co/u/lkapustina)\
**Post date:** [June 27, 2017, 7:05pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/10 "2017-06-27T19:05:49Z")

</div>

I fixed config\db.conf like this:

```
   input {     
    jdbc {
    jdbc_connection_string => "jdbc:sqlserver://alt.database.windows.net:1433;databaseName=zzz"
    jdbc_user => "zzz"
    jdbc_password => "zzz"
    jdbc_driver_library => "C:\elk\logstash-5.4.2\lib\sqljdbc41.jar"
    jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
    statement => "SELECT * from rep_mainTable"
    }
    }
    output {
    stdout { codec => json_lines }
    }

```

and it is works! Thank you very much!!!

---

<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:** [July 25, 2017, 7:06pm UTC](https://discuss.elastic.co/t/elk-stack-on-windows-server-with-mssql-db/91010/11 "2017-07-25T19:06:16Z")

</div>

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