Ubuntu Logstash Server with Kibana3 Front End Autoinstall

20 minute read

I have been using Graylog2 and VMware Log Insight for some time now and wanted to try out Logstash finally. So the first thing that I wanted to do was create an automated script to do most of the install and configuration to get everything running. I figured that as I am going through this I would share with everyone and start building on this script more based on feedback. I created a Graylog2 script (located here) that has proven to be of great help to the community and figured I might be able to do the same with the Logstash community, but even if it didn’t I would learn a great deal about Logstash in the meantime. There is a great community around Logstash so getting support should be very easy. As well as, I am just starting to learn Logstash now so this should be a lot of fun. Which also means that there will be a good amount of change around this post.

First off I will be keeping this script updated and available on Github located here. This will be the only location that I will be keeping up with it.

I would recommend using a clean install of Ubuntu 12.04 or 14.04 to install onto. However; if you decide to install on an existing server I am not responsible for anything that may get broken. :)

So here is how we get started and get everything up and running. Open up a terminal session on your server that you will be installing to and run the following commands.

For Logstash 1.3.x version: (OUTDATED!!)

sudo apt-get update
sudo apt-get -y install git
cd ~
git clone https://github.com/mrlesmithjr/Logstash_Kibana3
chmod +x ./Logstash_Kibana3/install_logstash_kibana_ubuntu.sh
sudo ./Logstash_Kibana3/install_logstash_kibana_ubuntu.sh
```jinja2

For Logstash 1.4.x version: **(CURRENT)**

```bash
sudo apt-get update
sudo apt-get -y install git
cd ~
git clone https://github.com/mrlesmithjr/Logstash_Kibana3
chmod +x ./Logstash_Kibana3/install_logstash_1.4_kibana_ubuntu.sh
sudo ./Logstash_Kibana3/install_logstash_1.4_kibana_ubuntu.sh
```jinja2

You will be prompted during the script to enter your domain name,
~~vSphere naming convention~~ and
[PFSense](https://www.pfsense.org/ "https\://www.pfsense.org/")Firewall
hostname. These will be used to configure logstash filtering for your
~~ESXi hosts~~ and PFSense Firewall. If you do not monitor any ~~vSphere
hosts~~ or use PFSense just enter some random info into these. These are
purely just collecting info to pass into a filtering rule for Logstash.

Once complete open your browser of choice and connect to
<http://logstashservername/kibana> or <http://ipaddress/kibana>.

You will see the following screen once connected. Seeing as we are
setting up Logstash with Kibana go ahead and select the link on the
left.

![19-31-11](../../assets/19-31-11-300x109.png)

![Screen Shot 2013-11-29 at 6.38.39 PM](../../assets/Screen-Shot-2013-11-29-at-6.38.39-PM-300x91.png)

Now here is a screenshot of some actual ESXi logging. Notice the tag
called VMware, that is created by the filtering rule that we created
with the installer which, is based off of the naming convention we
passed to the installer.

![Logstash_VMware_Dashboard](../../assets/Logstash_VMware_Dashboard-300x171.png)

`VMware dashboard`:
<noscript><pre>{
  &quot;title&quot;: &quot;VMware&quot;,
  &quot;services&quot;: {
    &quot;query&quot;: {
      &quot;list&quot;: {
        &quot;0&quot;: {
          &quot;query&quot;: &quot;*&quot;,
          &quot;alias&quot;: &quot;&quot;,
          &quot;color&quot;: &quot;#7EB26D&quot;,
          &quot;id&quot;: 0,
          &quot;pin&quot;: false,
          &quot;type&quot;: &quot;lucene&quot;,
          &quot;enable&quot;: true
        }
      },
      &quot;ids&quot;: [
        0
      ]
    },
    &quot;filter&quot;: {
      &quot;list&quot;: {
        &quot;0&quot;: {
          &quot;type&quot;: &quot;time&quot;,
          &quot;field&quot;: &quot;@timestamp&quot;,
          &quot;from&quot;: &quot;now-24h&quot;,
          &quot;to&quot;: &quot;now&quot;,
          &quot;mandate&quot;: &quot;must&quot;,
          &quot;active&quot;: true,
          &quot;alias&quot;: &quot;&quot;,
          &quot;id&quot;: 0
        },
        &quot;1&quot;: {
          &quot;type&quot;: &quot;querystring&quot;,
          &quot;query&quot;: &quot;tags:VMware&quot;,
          &quot;mandate&quot;: &quot;must&quot;,
          &quot;active&quot;: true,
          &quot;alias&quot;: &quot;&quot;,
          &quot;id&quot;: 1
        }
      },
      &quot;ids&quot;: [
        0,
        1
      ]
    }
  },
  &quot;rows&quot;: [
    {
      &quot;title&quot;: &quot;Graph&quot;,
      &quot;height&quot;: &quot;175px&quot;,
      &quot;editable&quot;: true,
      &quot;collapse&quot;: false,
      &quot;collapsable&quot;: true,
      &quot;panels&quot;: [
        {
          &quot;span&quot;: 12,
          &quot;editable&quot;: true,
          &quot;group&quot;: [
            &quot;default&quot;
          ],
          &quot;type&quot;: &quot;histogram&quot;,
          &quot;mode&quot;: &quot;count&quot;,
          &quot;time_field&quot;: &quot;@timestamp&quot;,
          &quot;value_field&quot;: null,
          &quot;auto_int&quot;: true,
          &quot;resolution&quot;: 100,
          &quot;interval&quot;: &quot;10m&quot;,
          &quot;fill&quot;: 3,
          &quot;linewidth&quot;: 3,
          &quot;timezone&quot;: &quot;browser&quot;,
          &quot;spyable&quot;: true,
          &quot;zoomlinks&quot;: true,
          &quot;bars&quot;: true,
          &quot;stack&quot;: false,
          &quot;points&quot;: false,
          &quot;lines&quot;: false,
          &quot;legend&quot;: true,
          &quot;x-axis&quot;: true,
          &quot;y-axis&quot;: true,
          &quot;percentage&quot;: false,
          &quot;interactive&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;selected&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;title&quot;: &quot;Events over time&quot;,
          &quot;intervals&quot;: [
            &quot;auto&quot;,
            &quot;1s&quot;,
            &quot;1m&quot;,
            &quot;5m&quot;,
            &quot;10m&quot;,
            &quot;30m&quot;,
            &quot;1h&quot;,
            &quot;3h&quot;,
            &quot;12h&quot;,
            &quot;1d&quot;,
            &quot;1w&quot;,
            &quot;1M&quot;,
            &quot;1y&quot;
          ],
          &quot;options&quot;: true,
          &quot;tooltip&quot;: {
            &quot;value_type&quot;: &quot;cumulative&quot;,
            &quot;query_as_alias&quot;: true
          },
          &quot;scale&quot;: 1,
          &quot;y_format&quot;: &quot;none&quot;,
          &quot;grid&quot;: {
            &quot;max&quot;: null,
            &quot;min&quot;: 0
          },
          &quot;annotate&quot;: {
            &quot;enable&quot;: false,
            &quot;query&quot;: &quot;*&quot;,
            &quot;size&quot;: 20,
            &quot;field&quot;: &quot;_type&quot;,
            &quot;sort&quot;: [
              &quot;_score&quot;,
              &quot;desc&quot;
            ]
          },
          &quot;pointradius&quot;: 5,
          &quot;show_query&quot;: true,
          &quot;legend_counts&quot;: true,
          &quot;zerofill&quot;: true,
          &quot;derivative&quot;: false
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;program&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Processes&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;syslog_level&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Syslog Level&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;@source_host&quot;,
          &quot;exclude&quot;: [
            &quot;&quot;
          ],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Hosts&quot;
        }
      ],
      &quot;notice&quot;: false
    },
    {
      &quot;title&quot;: &quot;Events&quot;,
      &quot;height&quot;: &quot;350px&quot;,
      &quot;editable&quot;: true,
      &quot;collapse&quot;: false,
      &quot;collapsable&quot;: true,
      &quot;panels&quot;: [
        {
          &quot;title&quot;: &quot;All events&quot;,
          &quot;error&quot;: false,
          &quot;span&quot;: 12,
          &quot;editable&quot;: true,
          &quot;group&quot;: [
            &quot;default&quot;
          ],
          &quot;type&quot;: &quot;table&quot;,
          &quot;size&quot;: 100,
          &quot;pages&quot;: 5,
          &quot;offset&quot;: 0,
          &quot;sort&quot;: [
            &quot;@timestamp&quot;,
            &quot;desc&quot;
          ],
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;9pt&quot;
          },
          &quot;overflow&quot;: &quot;min-height&quot;,
          &quot;fields&quot;: [
            &quot;@timestamp&quot;,
            &quot;@source_host&quot;,
            &quot;@message&quot;,
            &quot;program&quot;,
            &quot;syslog_level&quot;
          ],
          &quot;localTime&quot;: true,
          &quot;timeField&quot;: &quot;@timestamp&quot;,
          &quot;highlight&quot;: [],
          &quot;sortable&quot;: true,
          &quot;header&quot;: true,
          &quot;paging&quot;: true,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;field_list&quot;: true,
          &quot;status&quot;: &quot;Stable&quot;,
          &quot;trimFactor&quot;: 300,
          &quot;normTimes&quot;: true,
          &quot;all_fields&quot;: false
        }
      ],
      &quot;notice&quot;: false
    }
  ],
  &quot;editable&quot;: true,
  &quot;failover&quot;: false,
  &quot;index&quot;: {
    &quot;interval&quot;: &quot;day&quot;,
    &quot;pattern&quot;: &quot;[logstash-]YYYY.MM.DD&quot;,
    &quot;default&quot;: &quot;NO_TIME_FILTER_OR_INDEX_PATTERN_NOT_MATCHED&quot;,
    &quot;warm_fields&quot;: true
  },
  &quot;style&quot;: &quot;dark&quot;,
  &quot;panel_hints&quot;: true,
  &quot;pulldowns&quot;: [
    {
      &quot;type&quot;: &quot;query&quot;,
      &quot;collapse&quot;: true,
      &quot;notice&quot;: false,
      &quot;query&quot;: &quot;*&quot;,
      &quot;pinned&quot;: true,
      &quot;history&quot;: [
        &quot;*&quot;,
        &quot;tags:VMware&quot;,
        &quot;tag:VMware&quot;,
        &quot;type:VMware&quot;,
        &quot;host:\&quot;esxi01.everythingshouldbevirtual.local\&quot;&quot;,
        &quot;host:\&quot;esxi02.everythingshouldbevirtual.local\&quot;&quot;,
        &quot;host:\&quot;esxi03.everythingshouldbevirtual.local\&quot;&quot;
      ],
      &quot;remember&quot;: 10,
      &quot;enable&quot;: true
    },
    {
      &quot;type&quot;: &quot;filtering&quot;,
      &quot;collapse&quot;: true,
      &quot;notice&quot;: false,
      &quot;enable&quot;: true
    }
  ],
  &quot;nav&quot;: [
    {
      &quot;type&quot;: &quot;timepicker&quot;,
      &quot;collapse&quot;: false,
      &quot;notice&quot;: false,
      &quot;status&quot;: &quot;Stable&quot;,
      &quot;time_options&quot;: [
        &quot;5m&quot;,
        &quot;15m&quot;,
        &quot;1h&quot;,
        &quot;6h&quot;,
        &quot;12h&quot;,
        &quot;24h&quot;,
        &quot;2d&quot;,
        &quot;7d&quot;,
        &quot;30d&quot;
      ],
      &quot;refresh_intervals&quot;: [
        &quot;5s&quot;,
        &quot;10s&quot;,
        &quot;30s&quot;,
        &quot;1m&quot;,
        &quot;5m&quot;,
        &quot;15m&quot;,
        &quot;30m&quot;,
        &quot;1h&quot;,
        &quot;2h&quot;,
        &quot;1d&quot;
      ],
      &quot;timefield&quot;: &quot;@timestamp&quot;,
      &quot;now&quot;: true,
      &quot;filter_id&quot;: 0,
      &quot;enable&quot;: true
    }
  ],
  &quot;loader&quot;: {
    &quot;save_gist&quot;: false,
    &quot;save_elasticsearch&quot;: true,
    &quot;save_local&quot;: true,
    &quot;save_default&quot;: true,
    &quot;save_temp&quot;: true,
    &quot;save_temp_ttl_enable&quot;: true,
    &quot;save_temp_ttl&quot;: &quot;30d&quot;,
    &quot;load_gist&quot;: true,
    &quot;load_elasticsearch&quot;: true,
    &quot;load_elasticsearch_size&quot;: 20,
    &quot;load_local&quot;: true,
    &quot;hide&quot;: false
  },
  &quot;refresh&quot;: &quot;5m&quot;
}</pre></noscript><script src="https://gist.github.com/mrlesmithjr/8f8ff8e2e8e6f43cb701.js"> </script>

Here is another screenshot of logging graphs by adding different search
criteria items.

![10-22-26](../../assets/10-22-26-300x117.png)

So what we have done with this script is installed ~~Apache2~~, Nginx,
Elasticsearch, Logstash and Kibana3. ~~Logstash has been configured to
listen on UDP/514 (PFsense, SYSLOG and VMware), TCP/514 (recommended),
UDP/514 (syslog devices that cannot be sent to TCP/514) TCP/3515
(Windows Event Logs) and TCP/3525 (Windows IIS Logging).~~

Now setup your network devices to start sending their syslogs to the
HAProxy VIP and if your device supports sending via TCP, use it.
Reference the port list below on setting up some of the devices that are
pre-configured during the setup.

**Port List**

-   TCP/514 Syslog (Devices supporting TCP)
-   UDP/514 Syslog (Devices that do not support TCP)
-   TCP/1514 VMware ESXi
-   TCP/1515 VMware vCenter (Windows install or appliance) (For Windows
    install use NXLog from below in device setup) (For appliance reference
    device setup below)
-   TCP/3515 Windows Eventlog (Use NXLog from below in device setup)
-   TCP/3525 Windows IIS Logs (Use NXLog from below in device setup)

Below is a decent /etc/logstash/logstash.conf file that I am using and
will be updating periodically. Some of these settings will be included
in the install script but not all of them. You will need to change the
naming for ESXi and PFSense for your environment. (Or just use the
auto-install script).

<noscript><pre>input {
  redis {
    host =&gt; &quot;127.0.0.1&quot;
    data_type =&gt; &quot;list&quot;
    key =&gt; &quot;logstash&quot;
  }
}
input {
        udp {
                type =&gt; &quot;syslog&quot;
                port =&gt; &quot;514&quot;
        }
}
input {
        tcp {
                type =&gt; &quot;eventlog&quot;
                port =&gt; 3515
                format =&gt; &#39;json&#39;
        }
}
input {
        tcp {
                type =&gt; &quot;iis&quot;
                port =&gt; 3525
                format =&gt; &#39;json&#39;
        }
}
filter {
        if [type] == &quot;syslog&quot; {
                dns {
                        reverse =&gt; [ &quot;host&quot; ] action =&gt; &quot;replace&quot;
                }
                if [host] =~ /.*?(nsvpx).*?(everythingshouldbevirtual.local)?/ {
                        mutate {
                                add_tag =&gt; [ &quot;Netscaler&quot;, &quot;Ready&quot; ]
                        }
                }
                if [host] =~ /.*?(pfsense).*?(everythingshouldbevirtual.local)?/ {
                        mutate {
                                add_tag =&gt; [ &quot;PFSense&quot;, &quot;Ready&quot; ]
                        }
                }
                if [host] =~ /.*?(esxi).*?(everythingshouldbevirtual.local)?/ {
                        mutate {
                                add_tag =&gt; [ &quot;VMware&quot;, &quot;Ready&quot; ]
                        }
                }
                if [host] =~ /.*?(vcsa).*?(everythingshouldbevirtual.local)?/ {
                        mutate {
                                add_tag =&gt; [ &quot;vCenter&quot;, &quot;Ready&quot; ]
                        }
                }
                if &quot;Ready&quot; not in [tags] {
                        mutate {
                                add_tag =&gt; [ &quot;syslog&quot; ]
                        }
                }
        }
        if [type] == &quot;eventlog&quot; {
                mutate {
                        add_tag =&gt; [ &quot;WindowsEventLog&quot; ]
                }
        }
        if [type] == &quot;iis&quot; {
                mutate {
                        add_tag =&gt; [ &quot;IISLogs&quot; ]
                }
        }
}
filter {
        if [type] == &quot;syslog&quot; {
                mutate {
                        remove_tag =&gt; &quot;Ready&quot;
                }
        }
}
filter {
        if &quot;syslog&quot; in [tags] {

                grok {
                        match =&gt; { &quot;message&quot; =&gt; &quot;&lt;%{POSINT:syslog_pri}&gt;%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}&quot; }
                        add_field =&gt; [ &quot;received_at&quot;, &quot;%{@timestamp}&quot; ]
                        add_field =&gt; [ &quot;received_from&quot;, &quot;%{host}&quot; ]
                }
                syslog_pri { }
                date {
                        match =&gt; [ &quot;syslog_timestamp&quot;, &quot;MMM d HH:mm:ss&quot;, &quot;MMM dd HH:mm:ss&quot; ]
                }
                if !(&quot;_grokparsefailure&quot; in [tags]) {
                        mutate {
                                replace =&gt; [ &quot;@source_host&quot;, &quot;%{syslog_hostname}&quot; ]
                                replace =&gt; [ &quot;@message&quot;, &quot;%{syslog_message}&quot; ]
                        }
                }
                mutate {
                        remove_field =&gt; [ &quot;syslog_hostname&quot;, &quot;syslog_message&quot;, &quot;syslog_timestamp&quot; ]
                }
                if &quot;_grokparsefailure&quot; in [tags] {
                        drop { }
                }
        }
}
filter {
        if &quot;VMware&quot; in [tags] {
                grok {
                        break_on_match =&gt; false
                        match =&gt; [
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{TIMESTAMP_ISO8601:@timestamp} %{SYSLOGHOST:hostname} %{SYSLOGPROG:message_program}: (?&lt;message-body&gt;(?&lt;message_system_info&gt;(?:\[%{DATA:message_thread_id} %{DATA:syslog_level} \&#39;%{DATA:message_service}\&#39;\ ?%{DATA:message_opID}])) \[%{DATA:message_service_info}]\ (?&lt;message-syslog&gt;(%{GREEDYDATA})))&quot;,
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{TIMESTAMP_ISO8601:@timestamp} %{SYSLOGHOST:hostname} %{SYSLOGPROG:message_program}: (?&lt;message-body&gt;(?&lt;message_system_info&gt;(?:\[%{DATA:message_thread_id} %{DATA:syslog_level} \&#39;%{DATA:message_service}\&#39;\ ?%{DATA:message_opID}])) (?&lt;message-syslog&gt;(%{GREEDYDATA})))&quot;,
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{TIMESTAMP_ISO8601:@timestamp} %{SYSLOGHOST:hostname} %{SYSLOGPROG:message_program}: %{GREEDYDATA:message-syslog}&quot;
                        ]
                }
                syslog_pri { }
                mutate {
                        replace =&gt; [ &quot;@source_host&quot;, &quot;%{hostname}&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{message-syslog}&quot; ]
                }
                if &quot;Device naa&quot; in [message] {
                        grok {
                                match =&gt; [
                                        &quot;message&quot;, &quot;Device naa.%{WORD:device_naa} performance has %{WORD:device_status}&quot;
                                ]
                        }
                }
                if &quot;connectivity issues&quot; in [message] {
                        grok {
                                match =&gt; [
                                        &quot;message&quot;, &quot;Hostd: %{GREEDYDATA} : %{DATA:device_access} to volume %{DATA:device_id} %{DATA:datastore} (following|due to)&quot;
                                ]
                        }
                }
                if &quot;WARNING&quot; in [message] {
                        grok {
                                match =&gt; [
                                        &quot;message&quot;, &quot;WARNING: %{GREEDYDATA:vmware_warning_msg}&quot;
                                ]
                        }
                }
        }
        if &quot;_grokparsefailure&quot; in [tags] {
                if &quot;VMware&quot; in [tags] {
                        grok {
                                break_on_match =&gt; false
                                match =&gt; [
                                        &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{DATA:message_system_info}, (?&lt;message-body&gt;(%{SYSLOGHOST:hostname} %{SYSLOGPROG:message_program}: %{GREEDYDATA:message-syslog}))&quot;,
                                        &quot;message&quot;, &quot;${GREEDYDATA:message-syslog}&quot;
                                ]
                        }
                }
        }
}
filter {
        if &quot;vCenter&quot; in [tags] {
                grok {
                        break_on_match =&gt; false
                        match =&gt; [
                                &quot;message&quot;, &quot;%{TIMESTAMP_ISO8601:@timestamp} (?&lt;message-body&gt;(?&lt;message_system_info&gt;(?:\[%{DATA:message_thread_id} %{DATA:syslog_level} \&#39;%{DATA:message_service}\&#39;\ ?%{DATA:message_opID}])) \[%{DATA:message_service_info}]\ (?&lt;message-syslog&gt;(%{GREEDYDATA})))&quot;,
                                &quot;message&quot;, &quot;%{TIMESTAMP_ISO8601:@timestamp} (?&lt;message-body&gt;(?&lt;message_system_info&gt;(?:\[%{DATA:message_thread_id} %{DATA:syslog_level} \&#39;%{DATA:message_service}\&#39;\ ?%{DATA:message_opID}])) (?&lt;message-syslog&gt;(%{GREEDYDATA})))&quot;,
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{TIMESTAMP_ISO8601:@timestamp} %{GREEDYDATA:message-syslog}&quot;
                        ]
                }

                if &quot;_grokparsefailure&quot; in [tags] {
                        grok {
                                break_on_match =&gt; false
                                match =&gt; [
                                        &quot;message&quot;, &quot;${GREEDYDATA:message-syslog}&quot;
                                ]
                        }
                }
                syslog_pri { }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{message-syslog}&quot; ]
                        rename =&gt; [ &quot;host&quot;, &quot;@source_host&quot; ]
                        rename =&gt; [ &quot;hostname&quot;, &quot;syslog_source-hostname&quot; ]
                        rename =&gt; [ &quot;program&quot;, &quot;message_program&quot; ]
                        rename =&gt; [ &quot;message_vce_server&quot;, &quot;syslog_source-hostname&quot; ]
                        remove_field =&gt; [ &quot;@version&quot;, &quot;type&quot;, &quot;path&quot; ]
                }
        }
}
filter {
    if &quot;PFSense&quot; in [tags] {
        grok {
            add_tag =&gt; [ &quot;firewall&quot; ]
            match =&gt; [ &quot;message&quot;, &quot;&lt;(?&lt;evtid&gt;.*)&gt;(?&lt;datetime&gt;(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\s+(?:(?:0[1-9])|(?:[12][0-9])|(?:3[01])|[1-9]) (?:2[0123]|[01]?[0-9]):(?:[0-5][0-9]):(?:[0-5][0-9])) (?&lt;prog&gt;.*?): (?&lt;msg&gt;.*)&quot; ]
        }
        mutate {
            gsub =&gt; [&quot;datetime&quot;,&quot;  &quot;,&quot; &quot;]
        }
        date {
            match =&gt; [ &quot;datetime&quot;, &quot;MMM dd HH:mm:ss&quot; ]
        }
        mutate {
            replace =&gt; [ &quot;message&quot;, &quot;%{msg}&quot; ]
        }
        mutate {
            remove_field =&gt; [ &quot;msg&quot;, &quot;datetime&quot; ]
        }
    }
    if [prog] =~ /^pf$/ {
        mutate {
            add_tag =&gt; [ &quot;packetfilter&quot; ]
        }
        multiline {
            pattern =&gt; &quot;^\s+|^\t\s+&quot;
            what =&gt; &quot;previous&quot;
        }
        mutate {
            remove_field =&gt; [ &quot;msg&quot;, &quot;datetime&quot; ]
            remove_tag =&gt; [ &quot;multiline&quot; ]
        }
        grok {
            match =&gt; [ &quot;message&quot;, &quot;rule (?&lt;rule&gt;.*)\(.*\): (?&lt;action&gt;pass|block) .* on (?&lt;iface&gt;.*): .* proto (?&lt;proto&gt;TCP|UDP|IGMP|ICMP) .*\n\s*(?&lt;src_ip&gt;(\d+\.\d+\.\d+\.\d+))\.?(?&lt;src_port&gt;(\d*)) [&lt;|&gt;] (?&lt;dest_ip&gt;(\d+\.\d+\.\d+\.\d+))\.?(?&lt;dest_port&gt;(\d*)):&quot; ]
        }
    }
    if [prog] =~ /^dhcpd$/ {
        if [message] =~ /^DHCPACK|^DHCPREQUEST|^DHCPOFFER/ {
            grok {
                match =&gt; [ &quot;message&quot;, &quot;(?&lt;action&gt;.*) (on|for|to) (?&lt;src_ip&gt;[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]\.[0-2]?[0-9]?[0-9]) .*(?&lt;mac_address&gt;[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]).* via (?&lt;iface&gt;.*)&quot; ]
            }
        }
        if [message] =~ /^DHCPDISCOVER/ {
            grok {
                match =&gt; [ &quot;message&quot;, &quot;(?&lt;action&gt;.*) from (?&lt;mac_address&gt;[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]:[0-9a-fA-F][0-9a-fA-F]).* via (?&lt;iface&gt;.*)&quot; ]
            }
        }
        if [message] =~ /^DHCPINFORM/ {
            grok {
                match =&gt; [ &quot;message&quot;, &quot;(?&lt;action&gt;.*) from (?&lt;src_ip&gt;.*).* via (?&lt;iface&gt;.*)&quot; ]
            }
        }
   }
   if &quot;_grokparsefailure&quot; in [tags] {
        drop { }
   }

}
filter {
        if &quot;PFSense&quot; in [tags] {
                mutate {
                        replace =&gt; [ &quot;@source_host&quot;, &quot;%{host}&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{message}&quot; ]
                }
        }
}
filter {
        if &quot;Netscaler&quot; in [tags] {
                grok {
                        break_on_match =&gt; true
                        match =&gt; [
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt; %{DATE_US}:%{TIME} GMT %{SYSLOGHOST:syslog_hostname} %{GREEDYDATA:netscaler_message} : %{DATA} %{INT:netscaler_spcbid} - %{DATA} %{IP:netscaler_client_ip} - %{DATA} %{INT:netscaler_client_port} - %{DATA} %{IP:netscaler_vserver_ip} - %{DATA} %{INT:netscaler_vserver_port} %{GREEDYDATA:netscaler_message} - %{DATA} %{WORD:netscaler_session_type}&quot;,
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt; %{DATE_US}:%{TIME} GMT %{SYSLOGHOST:syslog_hostname} %{GREEDYDATA:netscaler_message}&quot;
                        ]
                }
                syslog_pri { }
                mutate {
                        replace =&gt; [ &quot;@source_host&quot;, &quot;%{host}&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{netscaler_message}&quot; ]
                }
                geoip {
                        source =&gt; &quot;netscaler_client_ip&quot;
                        target =&gt; &quot;geoip&quot;
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][longitude]}&quot; ]
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][latitude]}&quot;  ]
                }
                mutate {
                        convert =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;float&quot; ]
                }
        }
}
filter {
        if &quot;apache&quot; in [type] {
                geoip {
                        source =&gt; &quot;clientip&quot;
                        target =&gt; &quot;geoip&quot;
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][longitude]}&quot; ]
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][latitude]}&quot;  ]
                }
                mutate {
                        convert =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;float&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@source_host&quot;, &quot;%{host}&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{message}&quot; ]
                }
                mutate {
                        rename =&gt; [ &quot;verb&quot; , &quot;method&quot; ]
                }
                mutate {
                                add_tag =&gt; [ &quot;apache&quot; ]
                }
                grok {
                        match =&gt; [
                                &quot;message&quot;, &quot;%{DATA:apache_vhost} &quot;
                        ]
                }
        }
}
filter {
        if [type] == &quot;eventlog&quot; {
                grep {
                        match =&gt; { &quot;EventReceivedTime&quot;  =&gt; &quot;\d+&quot;}
                }
                mutate {
                        lowercase =&gt; [ &quot;EventType&quot;, &quot;FileName&quot;, &quot;Hostname&quot;, &quot;Severity&quot; ]
                }
                mutate {
                        rename =&gt; [ &quot;Hostname&quot;, &quot;@source_host&quot; ]
                }
                date {
                        match =&gt; [ &quot;EventReceivedTime&quot;, &quot;UNIX&quot; ]
                }
                mutate {
                        rename =&gt; [ &quot;Message&quot;, &quot;@message&quot; ]
                        rename =&gt; [ &quot;Severity&quot;, &quot;eventlog_severity&quot; ]
                        rename =&gt; [ &quot;SeverityValue&quot;, &quot;eventlog_severity_code&quot; ]
                        rename =&gt; [ &quot;Channel&quot;, &quot;eventlog_channel&quot; ]
                        rename =&gt; [ &quot;SourceName&quot;, &quot;eventlog_program&quot; ]
                        rename =&gt; [ &quot;SourceModuleName&quot;, &quot;nxlog_input&quot; ]
                        rename =&gt; [ &quot;Category&quot;, &quot;eventlog_category&quot; ]
                        rename =&gt; [ &quot;EventID&quot;, &quot;eventlog_id&quot; ]
                        rename =&gt; [ &quot;RecordNumber&quot;, &quot;eventlog_record_number&quot; ]
                        rename =&gt; [ &quot;ProcessID&quot;, &quot;eventlog_pid&quot; ]
                }
                mutate {
                        remove =&gt; [ &quot;SourceModuleType&quot;, &quot;EventTimeWritten&quot;, &quot;EventTime&quot;, &quot;EventReceivedTime&quot;, &quot;EventType&quot; ]
                }
        }
}
filter {
        if [type] == &quot;iis&quot; {
                if [message] =~ &quot;^#&quot; {
                                drop {}
                }
                grok {
                        match =&gt; [
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{SYSLOGTIMESTAMP} %{WORD:servername} %{TIMESTAMP_ISO8601} %{IP:hostip} %{WORD:method} %{URIPATH:request} (?:%{NOTSPACE:query}|-) %{NUMBER:port} (?:%{NOTSPACE:param}|-) %{IPORHOST:clientip} %{NOTSPACE:agent} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:bytes} %{NUMBER:time-taken}&quot;,
                                &quot;message&quot;, &quot;&lt;%{POSINT:syslog_pri}&gt;%{SYSLOGTIMESTAMP} %{WORD:servername} %{GREEDYDATA:syslog_message}&quot;
                        ]
                }
                date {
                         match =&gt; [&quot;eventtime&quot;, &quot;YY-MM-dd HH:mm:ss&quot;]
                }
                mutate {
                        replace =&gt; [ &quot;@source_host&quot;, &quot;%{servername}&quot; ]
                }
                mutate {
                        replace =&gt; [ &quot;@message&quot;, &quot;%{message}&quot; ]
                }
                geoip {
                        source =&gt; &quot;clientip&quot;
                        target =&gt; &quot;geoip&quot;
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][longitude]}&quot; ]
                        add_field =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;%{[geoip][latitude]}&quot;  ]
                }
                mutate {
                        convert =&gt; [ &quot;[geoip][coordinates]&quot;, &quot;float&quot; ]
                }
        }
}
filter {
        if [type] == &quot;mysql-slowquery&quot; {
                mutate {
                        add_tag =&gt; [ &quot;Mysql&quot; ]
                }
        }
}
output {
        elasticsearch_http {
                host =&gt; &quot;127.0.0.1&quot;
                flush_size =&gt; 1
                manage_template =&gt; true
                template =&gt; &quot;/opt/logstash/lib/logstash/outputs/elasticsearch/elasticsearch-template.json&quot;
        }
}</pre></noscript><script src="https://gist.github.com/mrlesmithjr/43b4e97bf16a7423bbd2.js"> </script>

For Windows Event Log's I highly recommend using NXLog for Windows. I
am including a fuctional nxlog.conf file for you to use as well with the
above logstash.conf configuration.

<noscript><pre>## Please set the ROOT to the folder your nxlog was installed into,
## otherwise it will not start.
  
#define ROOT C:\Program Files\nxlog
define ROOT C:\Program Files (x86)\nxlog
define ROOT_STRING C:\Program Files (x86)\\nxlog
  
Moduledir %ROOT%\modules
CacheDir %ROOT%\data
Pidfile %ROOT%\data\nxlog.pid
SpoolDir %ROOT%\data
LogFile %ROOT%\data\nxlog.log
  
# Enable json extension
&lt;Extension json&gt;
    Module      xm_json
&lt;/Extension&gt;

&lt;Extension syslog&gt;
    Module      xm_syslog
&lt;/Extension&gt;

&lt;Processor buffer1&gt;
    Module  pm_buffer
    MaxSize 1024
    Type    Mem
    WarnLimit   512
&lt;/Processor&gt;

&lt;Processor buffer2&gt;
    Module  pm_buffer
    MaxSize 1024
    Type    Mem
    WarnLimit   512
&lt;/Processor&gt;
  
# Nxlog internal logs
&lt;Input internal&gt;
   Module im_internal
   Exec $EventReceivedTime = integer($EventReceivedTime) / 1000000; to_json();
&lt;/Input&gt;
  
# Windows Event Log
&lt;Input eventlog&gt;
# Uncomment im_msvistalog for Windows Vista/2008 and later
   Module im_msvistalog
  
# Uncomment im_mseventlog for Windows XP/2000/2003
#   Module im_mseventlog
 
   Exec $EventReceivedTime = integer($EventReceivedTime) / 1000000; to_json();
&lt;/Input&gt;

# Select the input folder where logs will be scanned
# Create the parse rule for IIS logs. You can copy these from the header of the IIS log file.
# Uncomment Extension w3c for IIS logging
#&lt;Extension w3c&gt;
#    Module xm_csv
#    Fields $date, $time, $s-ip, $cs-method, $cs-uri-stem, $cs-uri-query, $s-port, $cs-username, $c-ip, $csUser-Agent, $cs-referrer, $sc-status, $sc-substatus, $sc-win32-status, $time-taken
#    FieldTypes string, string, string, string, string, string, integer, string, string, string, string, integer, integer, integer, integer
#    Delimiter &#39; &#39;
#&lt;/Extension&gt;

# Convert the IIS logs to JSON and use the original event time
# Uncomment IIS_IN section if logging for IIS logging
#&lt;Input IIS_IN&gt;
#    Module    im_file
#    File    &quot;C:\\inetpub\\logs\\LogFiles\\W3SVC2\\u_ex*&quot;
#    SavePos  TRUE
 
#    Exec if $raw_event =~ /^#/ drop();				\
#       else							\
#       {							\
#            w3c-&gt;parse_csv();					\
#            $EventTime = parsedate($date + &quot; &quot; + $time);	\
#            $SourceName = &quot;IIS&quot;;				\
#            $Message = to_json();				\
#       }
#&lt;/Input&gt;

# Uncomment vCenter_vpxd section for Windows vCenter logging 
#&lt;Input vCenter_vpxd&gt;
#	Module	im_file
#	File	&quot;C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd-*.log&quot;
#	Exec	$Message = $raw_event;
#	SavePos	TRUE
#	Recursive	TRUE
#&lt;/Input&gt;

# Uncomment vCenter_vpxd_alert section for Windows vCenter logging
#&lt;Input vCenter_vpxd_alert&gt;
#	Module	im_file
#	File	&quot;C:\ProgramData\VMware\VMware VirtualCenter\Logs\vpxd-alert-*.log&quot;
#	Exec	$Message = $raw_event;
#	SavePos	TRUE
#	Recursive	TRUE
#&lt;/Input&gt;

&lt;Processor t&gt;
   	Module pm_transformer
	OutputFormat syslog_rfc3164
&lt;/Processor&gt;

# Change Host below to match your naming
&lt;Output out&gt;
	Module 		om_tcp
	Host 		logstash
	Port 		3515
&lt;/Output&gt;
 
# Change Host below to match your naming
# Uncomment IIS_Out section if using IIS logging
#&lt;Output IIS_Out&gt;
#	Module om_tcp
#	Host logstash
#	Port 3525
#&lt;/Output&gt;

# Change Host below to match your naming
# Uncomment vCenter_out section for vCenter logging
#&lt;Output vCenter_out&gt;
#	Module om_tcp
#	Host logstash
#	Port 1515
#&lt;/Output&gt;

# Output routing
&lt;Route 1&gt;
   Path internal, eventlog =&gt; buffer1 =&gt; out
&lt;/Route&gt;

# Uncomment Route 2 if using IIS logging
#&lt;Route 2&gt;
#	Path IIS_In =&gt; IIS_Out
#&lt;/Route&gt;

# Uncomment Route 3 for vCenter logging
#&lt;Route 3&gt;
#	Path vCenter_vpxd, vCenter_vpxd_alert =&gt; t =&gt; vCenter_out
#&lt;/Route&gt;</pre></noscript><script src="https://gist.github.com/mrlesmithjr/cf212836b9ce162373ed.js"> </script>

Here is a screenshot of the Windows Logging if you want use the
dashboard view for Windows

<noscript><pre>{
  &quot;title&quot;: &quot;Windows&quot;,
  &quot;services&quot;: {
    &quot;query&quot;: {
      &quot;list&quot;: {
        &quot;0&quot;: {
          &quot;query&quot;: &quot;*&quot;,
          &quot;alias&quot;: &quot;&quot;,
          &quot;color&quot;: &quot;#7EB26D&quot;,
          &quot;id&quot;: 0,
          &quot;pin&quot;: false,
          &quot;type&quot;: &quot;lucene&quot;,
          &quot;enable&quot;: true
        }
      },
      &quot;ids&quot;: [
        0
      ]
    },
    &quot;filter&quot;: {
      &quot;list&quot;: {
        &quot;0&quot;: {
          &quot;type&quot;: &quot;time&quot;,
          &quot;field&quot;: &quot;@timestamp&quot;,
          &quot;from&quot;: &quot;now-24h&quot;,
          &quot;to&quot;: &quot;now&quot;,
          &quot;mandate&quot;: &quot;must&quot;,
          &quot;active&quot;: true,
          &quot;alias&quot;: &quot;&quot;,
          &quot;id&quot;: 0
        },
        &quot;1&quot;: {
          &quot;type&quot;: &quot;field&quot;,
          &quot;field&quot;: &quot;type&quot;,
          &quot;query&quot;: &quot;\&quot;eventlog\&quot;&quot;,
          &quot;mandate&quot;: &quot;must&quot;,
          &quot;active&quot;: true,
          &quot;alias&quot;: &quot;&quot;,
          &quot;id&quot;: 1
        }
      },
      &quot;ids&quot;: [
        0,
        1
      ]
    }
  },
  &quot;rows&quot;: [
    {
      &quot;title&quot;: &quot;Graph&quot;,
      &quot;height&quot;: &quot;175px&quot;,
      &quot;editable&quot;: true,
      &quot;collapse&quot;: false,
      &quot;collapsable&quot;: true,
      &quot;panels&quot;: [
        {
          &quot;span&quot;: 12,
          &quot;editable&quot;: true,
          &quot;group&quot;: [
            &quot;default&quot;
          ],
          &quot;type&quot;: &quot;histogram&quot;,
          &quot;mode&quot;: &quot;count&quot;,
          &quot;time_field&quot;: &quot;@timestamp&quot;,
          &quot;value_field&quot;: null,
          &quot;auto_int&quot;: true,
          &quot;resolution&quot;: 100,
          &quot;interval&quot;: &quot;10m&quot;,
          &quot;fill&quot;: 3,
          &quot;linewidth&quot;: 3,
          &quot;timezone&quot;: &quot;browser&quot;,
          &quot;spyable&quot;: true,
          &quot;zoomlinks&quot;: true,
          &quot;bars&quot;: true,
          &quot;stack&quot;: true,
          &quot;points&quot;: false,
          &quot;lines&quot;: false,
          &quot;legend&quot;: true,
          &quot;x-axis&quot;: true,
          &quot;y-axis&quot;: true,
          &quot;percentage&quot;: false,
          &quot;interactive&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;title&quot;: &quot;Events over time&quot;,
          &quot;intervals&quot;: [
            &quot;auto&quot;,
            &quot;1s&quot;,
            &quot;1m&quot;,
            &quot;5m&quot;,
            &quot;10m&quot;,
            &quot;30m&quot;,
            &quot;1h&quot;,
            &quot;3h&quot;,
            &quot;12h&quot;,
            &quot;1d&quot;,
            &quot;1w&quot;,
            &quot;1M&quot;,
            &quot;1y&quot;
          ],
          &quot;options&quot;: true,
          &quot;tooltip&quot;: {
            &quot;value_type&quot;: &quot;cumulative&quot;,
            &quot;query_as_alias&quot;: true
          },
          &quot;scale&quot;: 1,
          &quot;y_format&quot;: &quot;none&quot;,
          &quot;grid&quot;: {
            &quot;max&quot;: null,
            &quot;min&quot;: 0
          },
          &quot;annotate&quot;: {
            &quot;enable&quot;: false,
            &quot;query&quot;: &quot;*&quot;,
            &quot;size&quot;: 20,
            &quot;field&quot;: &quot;_type&quot;,
            &quot;sort&quot;: [
              &quot;_score&quot;,
              &quot;desc&quot;
            ]
          },
          &quot;pointradius&quot;: 5,
          &quot;show_query&quot;: true,
          &quot;legend_counts&quot;: true,
          &quot;zerofill&quot;: true,
          &quot;derivative&quot;: false
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;@source_host&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Host&#39;s&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;eventlog_category&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Event Categories&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;eventlog_severity&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;bar&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Event Severities&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;UserID&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;table&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Event UserID&#39;s&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;eventlog_channel&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;table&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Event Logs&quot;
        },
        {
          &quot;error&quot;: false,
          &quot;span&quot;: 4,
          &quot;editable&quot;: true,
          &quot;type&quot;: &quot;terms&quot;,
          &quot;loadingEditor&quot;: false,
          &quot;field&quot;: &quot;errorCode&quot;,
          &quot;exclude&quot;: [],
          &quot;missing&quot;: false,
          &quot;other&quot;: false,
          &quot;size&quot;: 10,
          &quot;order&quot;: &quot;count&quot;,
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;10pt&quot;
          },
          &quot;donut&quot;: false,
          &quot;tilt&quot;: false,
          &quot;labels&quot;: true,
          &quot;arrangement&quot;: &quot;horizontal&quot;,
          &quot;chart&quot;: &quot;table&quot;,
          &quot;counter_pos&quot;: &quot;above&quot;,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;tmode&quot;: &quot;terms&quot;,
          &quot;tstat&quot;: &quot;total&quot;,
          &quot;valuefield&quot;: &quot;&quot;,
          &quot;title&quot;: &quot;Top Error Codes&quot;
        }
      ],
      &quot;notice&quot;: false
    },
    {
      &quot;title&quot;: &quot;Events&quot;,
      &quot;height&quot;: &quot;350px&quot;,
      &quot;editable&quot;: true,
      &quot;collapse&quot;: false,
      &quot;collapsable&quot;: true,
      &quot;panels&quot;: [
        {
          &quot;title&quot;: &quot;All events&quot;,
          &quot;error&quot;: false,
          &quot;span&quot;: 12,
          &quot;editable&quot;: true,
          &quot;group&quot;: [
            &quot;default&quot;
          ],
          &quot;type&quot;: &quot;table&quot;,
          &quot;size&quot;: 100,
          &quot;pages&quot;: 5,
          &quot;offset&quot;: 0,
          &quot;sort&quot;: [
            &quot;@timestamp&quot;,
            &quot;desc&quot;
          ],
          &quot;style&quot;: {
            &quot;font-size&quot;: &quot;9pt&quot;
          },
          &quot;overflow&quot;: &quot;min-height&quot;,
          &quot;fields&quot;: [
            &quot;@timestamp&quot;,
            &quot;@source_host&quot;,
            &quot;@message&quot;,
            &quot;eventlog_category&quot;,
            &quot;eventlog_program&quot;,
            &quot;eventlog_severity&quot;,
            &quot;UserID&quot;,
            &quot;tags&quot;
          ],
          &quot;localTime&quot;: true,
          &quot;timeField&quot;: &quot;@timestamp&quot;,
          &quot;highlight&quot;: [],
          &quot;sortable&quot;: true,
          &quot;header&quot;: true,
          &quot;paging&quot;: true,
          &quot;spyable&quot;: true,
          &quot;queries&quot;: {
            &quot;mode&quot;: &quot;all&quot;,
            &quot;ids&quot;: [
              0
            ]
          },
          &quot;field_list&quot;: true,
          &quot;status&quot;: &quot;Stable&quot;,
          &quot;trimFactor&quot;: 300,
          &quot;normTimes&quot;: true,
          &quot;all_fields&quot;: false
        }
      ],
      &quot;notice&quot;: false
    }
  ],
  &quot;editable&quot;: true,
  &quot;failover&quot;: false,
  &quot;index&quot;: {
    &quot;interval&quot;: &quot;day&quot;,
    &quot;pattern&quot;: &quot;[logstash-]YYYY.MM.DD&quot;,
    &quot;default&quot;: &quot;NO_TIME_FILTER_OR_INDEX_PATTERN_NOT_MATCHED&quot;,
    &quot;warm_fields&quot;: true
  },
  &quot;style&quot;: &quot;dark&quot;,
  &quot;panel_hints&quot;: true,
  &quot;pulldowns&quot;: [
    {
      &quot;type&quot;: &quot;query&quot;,
      &quot;collapse&quot;: true,
      &quot;notice&quot;: false,
      &quot;query&quot;: &quot;*&quot;,
      &quot;pinned&quot;: true,
      &quot;history&quot;: [],
      &quot;remember&quot;: 10,
      &quot;enable&quot;: true
    },
    {
      &quot;type&quot;: &quot;filtering&quot;,
      &quot;collapse&quot;: true,
      &quot;notice&quot;: false,
      &quot;enable&quot;: true
    }
  ],
  &quot;nav&quot;: [
    {
      &quot;type&quot;: &quot;timepicker&quot;,
      &quot;collapse&quot;: false,
      &quot;notice&quot;: false,
      &quot;status&quot;: &quot;Stable&quot;,
      &quot;time_options&quot;: [
        &quot;5m&quot;,
        &quot;15m&quot;,
        &quot;1h&quot;,
        &quot;6h&quot;,
        &quot;12h&quot;,
        &quot;24h&quot;,
        &quot;2d&quot;,
        &quot;7d&quot;,
        &quot;30d&quot;
      ],
      &quot;refresh_intervals&quot;: [
        &quot;5s&quot;,
        &quot;10s&quot;,
        &quot;30s&quot;,
        &quot;1m&quot;,
        &quot;5m&quot;,
        &quot;15m&quot;,
        &quot;30m&quot;,
        &quot;1h&quot;,
        &quot;2h&quot;,
        &quot;1d&quot;
      ],
      &quot;timefield&quot;: &quot;@timestamp&quot;,
      &quot;now&quot;: true,
      &quot;filter_id&quot;: 0,
      &quot;enable&quot;: true
    }
  ],
  &quot;loader&quot;: {
    &quot;save_gist&quot;: false,
    &quot;save_elasticsearch&quot;: true,
    &quot;save_local&quot;: true,
    &quot;save_default&quot;: true,
    &quot;save_temp&quot;: true,
    &quot;save_temp_ttl_enable&quot;: true,
    &quot;save_temp_ttl&quot;: &quot;30d&quot;,
    &quot;load_gist&quot;: true,
    &quot;load_elasticsearch&quot;: true,
    &quot;load_elasticsearch_size&quot;: 20,
    &quot;load_local&quot;: true,
    &quot;hide&quot;: false
  },
  &quot;refresh&quot;: &quot;5m&quot;
}</pre></noscript><script src="https://gist.github.com/mrlesmithjr/42db96d077f4d1035186.js"> </script>

![Logstash_Windows_Dashboard](../../assets/Logstash_Windows_Dashboard-300x171.png)

** (OLD)**

~~If you want to purge and expire old logs have a look
[here](https://github.com/logstash/expire-logs "https\://github.com/logstash/expire-logs").
Jordan Sissel (creator of Logstash) has provided a python script to do
this.~~

~~Here is how you setup the script. Open a terminal on your Logstash
server and execute the following.~~

```bash
cd ~
sudo apt-get install python-pip
sudo apt-get install git
git clone https://github.com/logstash/expire-logs
cd expire-logs
sudo pip install -r requirements.txt
```bash

~~Now that you have this setup read the examples on the github link on
different scenarios.~~

~~After you purge your logs using the above method you will need to
restart elasticsearch.~~

```bash
sudo service elasticsearch restart

That should be it.

Enjoy!

All comments and feedback are very much welcomed and encouraged.

Interested in a highly available setup? Go here and checkout the Highly Available ELK (Elasticsearch, Logstash and Kibana) setup.

Updated: