Difference between enable Module and fetching logs directly

Hi,
I've recently enabled the IIS Module on filebeat. Once the module enabled and configured, i've looked at the IIS Filebeat dashboard. unfortunately there was no data to see.
After some research, i've found this website that explains how to configure IIS Module. It uses Logstash filters and i doesn't feel like it's the right thing to do.
In my mind i thought that IIS Modules would have been already proceed without any configuration needed (except for the log files path)
I am missing something ? Did i missed some configuration or did i missed understood something?
If IIS Module only get logs from files and output them in logstash as event what's the difference with regular logs aggregations ?

I'm not sure if this could be part of the issue but i've already set some filters in which events from IIS modules go through because i didn't find out how to make a condition based on event.module field.

Any explaination/help would be appreciate. Thanks by advance !

So the module will already do parsing and event normalization into ECS schema with local processing and through elasticsearch ingest pipelines. You don't need logstash for that to happen. As for not seeing any data, can you post your filebeat config and module config?

hi @legoguy1000, thanks for your reply !

Unfortunately, because i need to agregate data from inhouse apps i need to through logstash at some point.
For the module that confirm what i thought but it doesn't seems to do the parsing (i've tried to ouput the event through stdout using logstash and a lot of events were missing).

###################### Filebeat Configuration Example #########################

# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

# ============================== Filebeat inputs ===============================

filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.

- type: log

  # Change to true to enable this input configuration.
  ###RE enabled: false
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
  ###RE
    #- /var/log/*.log
    #- c:\programdata\elasticsearch\logs\*
    - D:\BonitaSubscription-7.10.4\server\logs\*
   

  # Exclude lines. A list of regular expressions to match. It drops the lines that are
  # matching any regular expression from the list.
  #exclude_lines: ['^DBG']

  # Include lines. A list of regular expressions to match. It exports the lines that are
  # matching any regular expression from the list.
  #include_lines: ['^ERR', '^WARN']

  # Exclude files. A list of regular expressions to match. Filebeat drops the files that
  # are matching any regular expression from the list. By default, no files are dropped.
  #exclude_files: ['.gz$']

  # Optional additional fields. These fields can be freely picked
  # to add additional information to the crawled log files for filtering
  #fields:
  #  level: debug
  #  review: 1

  ### Multiline options

  # Multiline can be used for log messages spanning multiple lines. This is common
  # for Java Stack Traces or C-Line Continuation

  # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
  #multiline.pattern: ^\[

  # Defines if the pattern set under pattern should be negated or not. Default is false.
  #multiline.negate: false

  # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
  # that was (not) matched before or after or as long as a pattern is not matched based on negate.
  # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
  #multiline.match: after

  multiline.type: pattern
  multiline.pattern: ^(?:\d\d){1,2}[/-](?:0?[1-9]|1[0-2])[/-](?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]) (?:2[0123]|[01]?[0-9]):(?:[0-5][0-9]):(?:(?:[0-5]?[0-9]|60)(?:[:.,][0-9]+)?) [+|-][0-9]{4} 
  multiline.negate: true
  multiline.match: after


# filestream is an experimental input. It is going to replace log input in the future.
- type: filestream

  # Change to true to enable this input configuration.
  enabled: false

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /var/log/*.log
    #- c:\programdata\elasticsearch\logs\*

  # Exclude lines. A list of regular expressions to match. It drops the lines that are
  # matching any regular expression from the list.
  #exclude_lines: ['^DBG']

  # Include lines. A list of regular expressions to match. It exports the lines that are
  # matching any regular expression from the list.
  #include_lines: ['^ERR', '^WARN']

  # Exclude files. A list of regular expressions to match. Filebeat drops the files that
  # are matching any regular expression from the list. By default, no files are dropped.
  #prospector.scanner.exclude_files: ['.gz$']

  # Optional additional fields. These fields can be freely picked
  # to add additional information to the crawled log files for filtering
  #fields:
  #  level: debug
  #  review: 1

# ============================== Filebeat modules ==============================

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: false

  # Period on which files under path should be checked for changes
  #reload.period: 10s

# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false


# ================================== General ===================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

###RE
name: "server_name-dev-bonita_web"
tags: ["filebeat", "server_name", "dev", "bonita_web"]

# The tags of the shipper are included in their own field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging

# ================================= Dashboards =================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboards archive. By default this URL
# has a value which is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
#setup.kibana:

  # Kibana Host
  # Scheme and port can be left out and will be set to the default (http and 5601)
  # In case you specify and additional path, the scheme is required: http://localhost:5601/path
  # IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
  #host: "localhost:5601"
  ####RE
  #host: "10.70.111.55:5601"

  # Kibana Space ID
  # ID of the Kibana Space into which the dashboards should be loaded. By default,
  # the Default Space will be used.
  #space.id:

# =============================== Elastic Cloud ================================

# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

# ---------------------------- Elasticsearch Output ----------------------------
#output.elasticsearch:
  # Array of hosts to connect to.
  #hosts: ["localhost:9200"]
  #hosts: ["IP_Address:9200"]

  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "changeme"

# ------------------------------ Logstash Output -------------------------------
output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]
  ####RE
  hosts: ["IP_Address:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

# ================================= Processors =================================
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

# ================================== Logging ===================================

# Sets log level. The default log level is info.
# Available log levels are: error, warning, info, debug
#logging.level: debug

# At debug level, you can selectively enable logging only for some components.
# To enable all selectors use ["*"]. Examples of other selectors are "beat",
# "publisher", "service".
#logging.selectors: ["*"]
#####RE
logging.ecs: true 
# ============================= X-Pack Monitoring ==============================
# Filebeat can export internal metrics to a central Elasticsearch monitoring
# cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
# reporting is disabled by default.

# Set to true to enable the monitoring reporter.
#monitoring.enabled: false

# Sets the UUID of the Elasticsearch cluster under which monitoring data for this
# Filebeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
# is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
#monitoring.cluster_uuid:

# Uncomment to send the metrics to Elasticsearch. Most settings from the
# Elasticsearch output are accepted here as well.
# Note that the settings should point to your Elasticsearch *monitoring* cluster.
# Any setting that is not set is automatically inherited from the Elasticsearch
# output configuration, so if you have the Elasticsearch output configured such
# that it is pointing to your Elasticsearch monitoring cluster, you can simply
# uncomment the following line.
#monitoring.elasticsearch:

# ============================== Instrumentation ===============================

# Instrumentation support for the filebeat.
#instrumentation:
    # Set to true to enable instrumentation of filebeat.
    #enabled: false

    # Environment in which filebeat is running on (eg: staging, production, etc.)
    #environment: ""

    # APM Server hosts to report instrumentation results to.
    #hosts:
    #  - http://localhost:8200

    # API Key for the APM Server(s).
    # If api_key is set then secret_token will be ignored.
    #api_key:

    # Secret token for the APM Server(s).
    #secret_token:


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true

With IIS Module Enable (using command), path file set for access but not for errors and access enable but not error.
Unfortunately i do not have access to the file itself right now since it's on a server i do not have access to.

Am I the only one who wants to use a module and logstash at the same time ?
I really can't find anything on that subject and it makes me and my company stuck :confused:
I must admit that i'm starting to feel lost about this...

So u can absolutely use logstash with modules BUT know that a lot of modules do the majority of the processing in the elasticsearch ingest pipeline so the data may not be in a great format going into logstash. As time goes on and the transition to the elastic agent, all the processing has been moved to the ingest pipelines.

Hi @Dzious

I pretty much explain exactly how do do this here

This means using logstash as an aggregation point ... I also discussed that in this thread

Example Architecture
Many Filebeat(s) -> Logstash -> Elasticsearch or Elastic Cloud

Just substitute winlogbeat with filebeat in the steps.

Also here is the reference in the docs

Hi @stephenb,
Thanks for your help.
Unfortunately even after following each of your links I still didn't managed to have formated logs out of IIS Module...
The only thing i manage to have is a row event with the message that isn't even log.original

I really don't understand what i'm doing wrong... :confused:

If the IIS log formats are customized / non-standard they won't automatically parse. I suspect that may be the issue.

If so there are a couple options.... take a look and see if you can figure out the pattern ... come back.

Alright thanks.
I wasn't aware we could customize IIS output.

Unless i'm making a mistake this looks like it hasn't been touch:
2021-06-07 12:51:26 XX.XX.XXX.XX GET /WebParam/Question - 80 username XX.XX.XX.XXX Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271

After asking to our sys admin, he told me we are using W3C format. Could this be an issue ?

Also i've checked Filebeat logs and they only contains two lines and none of them are errors

What does a couple of the documents from Discover look like or I don't think that is the default IIS format so

GET filebeat-7.13.0-00001/_search

Huh I just set up... this

filebeat modules enable iis
filebeat setup -e

This is setup Filebeat -> Elasticsearch no changes except where to point elasticsearch

iis.yml

- module: iis
  # Access logs
  access:
    enabled: true

    # Set custom paths for the log files. If left empty,
    # Filebeat will choose the paths depending on your OS.
    var.paths: [ "/Users/sbrown/workspace/elastic-install/7.13.0/filebeat-7.13.0-darwin-x86_64_mod/iis.log"]

iis.log file

2021-06-07 12:51:26 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271
2021-06-07 12:51:27 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271
2021-06-07 12:51:28 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271
2021-06-07 12:51:29 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271

Looks like it Worked parsed perfectly.

Screen Shot

Discover

After a day of tests Here is my output :
Filebeat -> ElasticSearch (same setup as you did, i started all over again to make sure it was ok) :

{
  "_index": "filebeat-7.12.0-2021.06.08-000001",
  "_type": "_doc",
  "_id": "HWCk63kBkbHS6yBoemQi",
  "_version": 1,
  "_score": null,
  "fields": {
    "event.category": [
      "web",
      "network"
    ],
    "host.os.name.text": [
      "Windows Server 2016 Standard"
    ],
    "user_agent.original.text": [
      "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36"
    ],
    "host.hostname": [
      "HOSTNAME"
    ],
    "traefik.access.geoip.location": [
      {
        "coordinates": [
          -97.822,
          37.751
        ],
        "type": "Point"
      }
    ],
    "user_agent.os.version": [
      "10"
    ],
    "host.mac": [
      "00:00:00:00:00:00:00:e0"
    ],
    "traefik.access.user_agent.name": [
      "Chrome"
    ],
    "service.type": [
      "iis"
    ],
    "http.request.method": [
      "GET"
    ],
    "host.os.version": [
      "10.0"
    ],
    "host.os.name": [
      "Windows Server 2016 Standard"
    ],
    "traefik.access.user_agent.original": [
      "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36"
    ],
    "source.ip": [
      "8.8.8.8"
    ],
    "destination.address": [
      "8.8.8.8"
    ],
    "agent.name": [
      "HOSTNAME"
    ],
    "host.name": [
      "HOSTNAME"
    ],
    "user_agent.version": [
      "78.0.3904.87"
    ],
    "http.response.status_code": [
      200
    ],
    "event.kind": [
      "event"
    ],
    "iis.access.win32_status": [
      64
    ],
    "event.outcome": [
      "success"
    ],
    "user_agent.original": [
      "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36"
    ],
    "host.os.type": [
      "windows"
    ],
    "traefik.access.geoip.country_iso_code": [
      "US"
    ],
    "fileset.name": [
      "access"
    ],
    "input.type": [
      "log"
    ],
    "log.offset": [
      0
    ],
    "user_agent.name": [
      "Chrome"
    ],
    "agent.hostname": [
      "HOSTNAME"
    ],
    "related.user": [
      "username"
    ],
    "host.architecture": [
      "x86_64"
    ],
    "suricata.eve.http.status": [
      200
    ],
    "url.path": [
      "/WebParam/Question"
    ],
    "agent.id": [
      "bb3c0327-eef7-4a11-a471-69678f92cd55"
    ],
    "iis.access.sub_status": [
      0
    ],
    "ecs.version": [
      "1.8.0"
    ],
    "event.created": [
      "2021-06-08T12:41:31.082Z"
    ],
    "agent.version": [
      "7.12.0"
    ],
    "host.os.family": [
      "windows"
    ],
    "source.as.number": [
      15169
    ],
    "suricata.eve.src_ip": [
      "8.8.8.8"
    ],
    "destination.port": [
      80
    ],
    "user_agent.os.full": [
      "Windows 10"
    ],
    "user.name": [
      "username"
    ],
    "suricata.eve.http.http_refer": [
      "http://domain-name.fr/WebParam/"
    ],
    "source.geo.location": [
      {
        "coordinates": [
          -97.822,
          37.751
        ],
        "type": "Point"
      }
    ],
    "source.address": [
      "8.8.8.8"
    ],
    "user_agent.os.name.text": [
      "Windows"
    ],
    "suricata.eve.alert.action": [
      "success"
    ],
    "user_agent.os.name": [
      "Windows"
    ],
    "host.os.build": [
      "14393.4350"
    ],
    "host.ip": [
      "HIDDEN IPS",
    ],
    "agent.type": [
      "filebeat"
    ],
    "event.module": [
      "iis"
    ],
    "related.ip": [
      "8.8.8.8",
      "8.8.8.8"
    ],
    "host.os.kernel": [
      "10.0.14393.4350 (rs1_release.210407-2154)"
    ],
    "source.geo.country_iso_code": [
      "US"
    ],
    "host.id": [
      "cc18fa3f-e6fe-4b77-bf77-009a0c7373b2"
    ],
    "source.as.organization.name.text": [
      "Google LLC"
    ],
    "http.request.referrer": [
      "http://domain-name.fr/WebParam/"
    ],
    "traefik.access.user_agent.device": [
      "Other"
    ],
    "suricata.eve.http.http_user_agent": [
      "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36"
    ],
    "source.geo.continent_name": [
      "North America"
    ],
    "source.as.organization.name": [
      "Google LLC"
    ],
    "traefik.access.geoip.continent_name": [
      "North America"
    ],
    "suricata.eve.http.http_method": [
      "GET"
    ],
    "destination.ip": [
      "8.8.8.8"
    ],
    "suricata.eve.dest_ip": [
      "8.8.8.8"
    ],
    "traefik.access.user_agent.os_name": [
      "Windows"
    ],
    "event.duration": [
      1271000000
    ],
    "user_agent.os.full.text": [
      "Windows 10"
    ],
    "event.ingested": [
      "2021-06-08T12:41:35.497Z"
    ],
    "@timestamp": [
      "2021-06-08T11:00:00.000Z"
    ],
    "host.os.platform": [
      "windows"
    ],
    "suricata.eve.dest_port": [
      80
    ],
    "event.type": [
      "connection"
    ],
    "log.file.path": [
      "C:\\FILEPATH\\Test_IIS_2.log"
    ],
    "agent.ephemeral_id": [
      "8efeccc3-2006-493c-8a9d-42c3070adb92"
    ],
    "user_agent.device.name": [
      "Other"
    ],
    "source.geo.country_name": [
      "United States"
    ],
    "event.dataset": [
      "iis.access"
    ],
    "user.name.text": [
      "username"
    ]
  },
  "sort": [
    1623150000000
  ]
}

Here parse seems ok, fields has been added and message field has been removed

Filebeat -> Logstash -> Elastic

{
  "_index": "filebeat-test",
  "_type": "_doc",
  "_id": "zGD563kBkbHS6yBon2ac",
  "_version": 1,
  "_score": null,
  "fields": {
    "agent.version.keyword": [
      "7.12.0"
    ],
    "host.architecture.keyword": [
      "x86_64"
    ],
    "host.name.keyword": [
      "HOSTNAME"
    ],
    "event.dataset.keyword": [
      "iis.access"
    ],
    "host.os.build.keyword": [
      "14393.4350"
    ],
    "host.hostname": [
      "HOSTNAME"
    ],
    "host.mac": [
      "HIDDEN"
    ],
    "agent.hostname.keyword": [
      "HOSTNAME"
    ],
    "service.type": [
      "iis"
    ],
    "ecs.version.keyword": [
      "1.8.0"
    ],
    "host.ip.keyword": [
      "HIDDEN IPS"
    ],
    "host.os.version": [
      "10.0"
    ],
    "host.os.name": [
      "Windows Server 2016 Standard"
    ],
    "agent.name": [
      "HOSTNAME"
    ],
    "host.id.keyword": [
      "cc18fa3f-e6fe-4b77-bf77-009a0c7373b2"
    ],
    "host.name": [
      "HOSTNAME"
    ],
    "host.os.version.keyword": [
      "10.0"
    ],
    "host.os.type": [
      "windows"
    ],
    "agent.id.keyword": [
      "1f6b65b8-83bd-4b4f-bcb4-c3892f4cb85c"
    ],
    "fileset.name": [
      "access"
    ],
    "input.type": [
      "log"
    ],
    "@version.keyword": [
      "1"
    ],
    "log.offset": [
      4370
    ],
    "agent.hostname": [
      "HOSTNAME"
    ],
    "tags": [
      "beats_input_codec_plain_applied"
    ],
    "host.architecture": [
      "x86_64"
    ],
    "fileset.name.keyword": [
      "access"
    ],
    "agent.id": [
      "1f6b65b8-83bd-4b4f-bcb4-c3892f4cb85c"
    ],
    "ecs.version": [
      "1.8.0"
    ],
    "message.keyword": [
      "2021-06-08 11:00:00 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271"
    ],
    "event.module.keyword": [
      "iis"
    ],
    "host.hostname.keyword": [
      "HOSTNAME"
    ],
    "agent.version": [
      "7.12.0"
    ],
    "host.os.family": [
      "windows"
    ],
    "service.type.keyword": [
      "iis"
    ],
    "input.type.keyword": [
      "log"
    ],
    "tags.keyword": [
      "beats_input_codec_plain_applied"
    ],
    "host.os.build": [
      "14393.4350"
    ],
    "host.ip": [
      "HIDDEN IPS"
    ],
    "agent.type": [
      "filebeat"
    ],
    "event.module": [
      "iis"
    ],
    "host.os.kernel.keyword": [
      "10.0.14393.4350 (rs1_release.210407-2154)"
    ],
    "host.os.kernel": [
      "10.0.14393.4350 (rs1_release.210407-2154)"
    ],
    "@version": [
      "1"
    ],
    "host.os.name.keyword": [
      "Windows Server 2016 Standard"
    ],
    "host.id": [
      "cc18fa3f-e6fe-4b77-bf77-009a0c7373b2"
    ],
    "log.file.path.keyword": [
      "C:\\FILEPATH\\Test_IIS_2.log"
    ],
    "agent.type.keyword": [
      "filebeat"
    ],
    "agent.ephemeral_id.keyword": [
      "dd809d6e-63eb-4c77-964d-dbc7402f0791"
    ],
    "host.mac.keyword": [
      "HIDDEN IPS"
    ],
    "agent.name.keyword": [
      "HOSTNAME"
    ],
    "message": [
      "2021-06-08 11:00:00 8.8.8.8 GET /WebParam/Question - 80 username 8.8.8.8 Mozilla/5.0+(Windows+NT+10.0;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/78.0.3904.87+Safari/537.36 http://domain-name.fr/WebParam/ 200 0 64 1271"
    ],
    "host.os.family.keyword": [
      "windows"
    ],
    "@timestamp": [
      "2021-06-08T14:14:33.270Z"
    ],
    "host.os.type.keyword": [
      "windows"
    ],
    "host.os.platform": [
      "windows"
    ],
    "host.os.platform.keyword": [
      "windows"
    ],
    "log.file.path": [
      "C:\\FILEPATH\\Test_IIS_2.log"
    ],
    "agent.ephemeral_id": [
      "dd809d6e-63eb-4c77-964d-dbc7402f0791"
    ],
    "event.dataset": [
      "iis.access"
    ]
  },
  "sort": [
    1623161673270
  ]
}

This one is not formatted correctly even if the only thing i touched is filebeat output.
I'm starting to think that we're not able to use module with logstash at all :confused:
I'll use the grok patterns and "mutates?" i've found in IIS pipeline.yml and transfer them into logstash to make the same thing...

Yes you can use filebeat -> logstash -> ElasticSearch with modules, absolutely supported, it is a very common architecture. You just have to configure correctly. I suspect your logstash conf is not correct.

To use Logstash in the filebeat.yml.

Assuming you already have Filebeat -> Elaticsearch working (you ran setup, tested etc..etc..etc)
You still need to have run setup even if you want to use logstash as a pass through.

Then

  1. comment out the elasticsearch output in filebeat.yml
  2. set the logstash output and pipeline in the filebeat.yml
output.logstash:
  # The Logstash hosts
  hosts: ["localhost:5044"]
  1. Use this for your logstash.conf.
    This acts as a pass through and forwards the pipeline definition to elasticsearch
################################################
# beats->logstash->es default config.
################################################
input {
  beats {
    port => 5044
  }
}

output {
  if [@metadata][pipeline] {
    elasticsearch {
      cloud_auth => "elastic:password"
      cloud_id => "mycloud:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRj......"

      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
      pipeline => "%{[@metadata][pipeline]}" 
    }
  } else {
    elasticsearch {
      cloud_auth => "elastic:password"
      cloud_id => "mycloud:dXMtZWFzdC0xLmF3cy5mb3VuZC5pbyRj......"
      manage_template => false
      index => "%{[@metadata][beat]}-%{[@metadata][version]}"
    }
  }
}

I have the exact same as I showed above working
Filebeat -> Logstash -> Elasticsearch using the above configuration

1 Like

Alright.
I did not understood the pipeline thing.
Thanks for being so patient. You really made my day :heart:

1 Like

Glad we could help!

1 Like

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