Downloads:

12,109

Downloads of v 1.4.2.09161814:

579

Last Update:

17 Sep 2014

Package Maintainer(s):

Software Author(s):

  • logstash

Tags:

logstash, logging

logstash

This is not the latest version of logstash available.

1.4.2.09161814 | Updated: 17 Sep 2014

Downloads:

12,109

Downloads of v 1.4.2.09161814:

579

Software Author(s):

  • logstash

logstash 1.4.2.09161814

This is not the latest version of logstash available.

All Checks are Unknown

2 Test of Unknown Status


Validation Testing Unknown


Verification Testing Unknown

To install logstash, run the following command from the command line or from PowerShell:

>

To upgrade logstash, run the following command from the command line or from PowerShell:

>

To uninstall logstash, run the following command from the command line or from PowerShell:

>

NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://chocolatey.org/api/v2. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Enter your internal repository url

(this should look similar to https://chocolatey.org/api/v2)

4. Choose your deployment method:


choco upgrade logstash -y --source="'STEP 3 URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade logstash -y --source="'STEP 3 URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Ensure logstash installed
  win_chocolatey:
    name: logstash
    state: present
    version: 1.4.2.09161814
    source: STEP 3 URL

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.

Coming early 2020! Central Managment Reporting available now! More information...


chocolatey_package 'logstash' do
  action    :install
  version  '1.4.2.09161814'
  source   'STEP 3 URL'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


Chocolatey::Ensure-Package
(
    Name: logstash,
    Version: 1.4.2.09161814,
    Source: STEP 3 URL
);

Requires Otter Chocolatey Extension. See docs at https://inedo.com/den/otter/chocolatey.


cChocoPackageInstaller logstash
{
   Name     = 'logstash'
   Ensure   = 'Present'
   Version  = '1.4.2.09161814'
   Source   = 'STEP 3 URL'
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'logstash':
  provider => 'chocolatey',
  ensure   => '1.4.2.09161814',
  source   => 'STEP 3 URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


salt '*' chocolatey.install logstash version="1.4.2.09161814" source="STEP 3 URL"

See docs at https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html.

5. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

This package was approved as a trusted package on 02 May 2018.

Description

Logstash is a tool for managing events and logs. You can use it to collect logs, parse them, and store them for later use (like, for searching).
This package installs logstash as an agent service via nssm. All you need to do - is to configure your logstash.conf in conf.d\ directory and start Logstash service (sc start Logstash).
Service is installed using nssm and is calling bin\logstash.cmd which wraps bin\logstash.bat with these parameters: "logstash.bat agent --config c:/logstash/conf.d/ --log c:/logstash/log/logstash.log"
Package update backs up previous logstash directory to c:\logstash-old_DATETIME. Available parameters:
backup (default=true) # Enables or disables backup copy of the previous installation
config (default=false) # Drops a simple working config instead of .sample
autostart (default=false) # Starts logstash service after installation.

Example:
-params 'backup=true;config=false;autostart=true'


This package is updated automatically to use new url when a new version comes out.

tools\chocolateyInstall.ps1
# $package_version = 
$url=""

$package_name = 'logstash'
$service_name = "Logstash"
$package_dir="c:\${package_name}"

$current_datetime = Get-Date -format yyyyddMMhhmm
#$package_backup_dir = Join-Path ${package_dir} "${package_name}-old_${current_datetime}"
$package_backup_dir = "${package_dir}-old_${current_datetime}"

$bin_dir = $(Join-Path $package_dir "bin")
$log_dir = $(Join-Path $package_dir "log")
$config_dir = $(Join-Path $package_dir "conf.d")
$config_sample_dir = $(Join-Path $package_dir "conf.d.sample")

$log_file = $(Join-Path $log_dir "${package_name}.log")
$cmd_file = $(Join-Path $bin_dir "${package_name}.cmd")
$config_file = $(Join-Path $config_dir "${package_name}.conf")
$config_sample_file = $(Join-Path $config_dir "${package_name}.conf.sample")


## Additional Parameters ##
$autostart_enabled = $false
$backup_enabled = $true
$config_enabled = $false
if (![string]::IsNullOrEmpty($env:chocolateyPackageParameters))
{
	if ($env:chocolateyPackageParameters.ToLower().Contains("autostart") -or $env:chocolateyPackageParameters.ToLower().Contains("backup") -or $env:chocolateyPackageParameters.ToLower().Contains("config") )
	{		
		# Getting Parameters
		$rawTxt =  [regex]::escape($env:chocolateyPackageParameters)
		$params = $($rawTxt -split ';' | ForEach-Object {
		   $temp= $_ -split '='
		   "{0}={1}" -f $temp[0].Substring(0,$temp[0].Length),$temp[1]
		} | ConvertFrom-StringData)


		if ($params.autostart -eq 'true')
		{			
			Write-Host "Found 'autostart' parameter enabled."
			$autostart_enabled = $true
			
		}
		else
		{
			Write-Host "Found 'autostart' parameter disabled."
			$autostart_enabled = $false
		}
		
		if ($params.backup -eq 'true')
		{			
			Write-Host "Found 'backup' parameter enabled."
			$backup_enabled = $true
			
		}
		else
		{
			Write-Host "Found 'backup' parameter disabled."
			$backup_enabled = $false
		}
		
		if ($params.config -eq 'true')
		{			
			Write-Host "Found 'config' parameter enabled. Sample config will be saved as conf.d\logstash.conf"
			$config_enabled = $true
			
		}
		else
		{
			Write-Host "Found 'config' parameter disabled."
			$config_enabled = $false
		}
	}
}

try {                                                                                                           if (Test-Path -path $package_dir) {
    if (!(Test-Path -path ${package_backup_dir})) {
    
        if ($backup_enabled)
		{
			New-Item "${package_backup_dir}" -Type Directory | Out-Null
			Write-Host "Backing up current ${package_name} installation to ${package_backup_dir}."
			Copy-Item -Recurse "${package_dir}\*" ${package_backup_dir} -Exclude *-old*
		}
		
        Write-Host "Uninstalling current version of ${package_name}"
        cuninst logstash

        if ($LastExitCode -ne 0) {
            try {
    
                if ($(Get-Service "$service_name" -ErrorAction SilentlyContinue).Status -eq "Running") {
                    #Start-ChocolateyProcessAsAdmin "\\localhost stop `"${service_name}`"" "sc.exe"
                    Start-ChocolateyProcessAsAdmin "Stop-Service ${service_name} -Force"
                    Start-Sleep 2
                }
    
    
    
                if ($(Get-Service "$service_name"  -ErrorAction SilentlyContinue).Status -ne "Running") {
                    Remove-Item -recurse $(Join-Path $package_dir "\*") -exclude *.conf.*, *-bak*, *-old*
                }

                # Write-ChocolateySuccess $package_name
            } catch {
                Write-ChocolateyFailure $package_name "$($_.Exception.Message)"
                throw
            }
        }
    } else {
        Write-Error "Can't create more than 1 backup per minute (I know that's stupid). Please try in 1 minute."
    }


        Write-Host "Continuing ${package_name} installation"
    }

    
    
    #Write-Host "Making sure ${config_sample_dir} is in place"
    #if (!(Test-Path -path $config_sample_dir)) {New-Item $config_sample_dir -Type Directory  | Out-Null}

    Write-Host "Making sure ${config_dir} is in place"
    if (!(Test-Path -path $config_dir)) {New-Item $config_dir -Type Directory  | Out-Null}


    Write-Host "Making sure ${package_dir} is in place"
    if (!(Test-Path -path $package_dir)) {New-Item $package_dir -Type Directory  | Out-Null}

    Write-Host "Making sure ${log_dir} is in place"
    if (!(Test-Path -path $log_dir)) { New-Item $log_dir -Type Directory  | Out-Null }

    Install-ChocolateyZipPackage "${package_name}" $url $package_dir
    Move-Item "$(Join-Path ${package_dir} logstash-*\*)" "${package_dir}" -Force
    Remove-Item "$(Join-Path ${package_dir} logstash-*)" -Force


    if (!(Test-Path ($cmd_file)))
    {
      $cmdcontent = @"
cd /d ${package_dir}
bin/logstash.bat agent --config ${config_dir} --log ${log_file}
"@
        echo "Dropping a ${package_name}.cmd file"
        Set-Content $cmd_file $cmdcontent -Encoding ASCII -Force
    }


    if (!(Test-Path ($config_sample_file)))
    {
      $confcontent = @"
input {
    stdin {}
}

output {
    stdout {}
}
"@  

        if ($config_enabled)
		{
			echo "Dropping a ${config_file} file (so you can start ${package_name} service right away."
			Set-Content $config_file $confcontent -Encoding ASCII -Force		
		}
		else
		{
			echo "Dropping a sample ${package_name}.conf.sample file - rename it to logstash.conf if you want to use it!"
			Set-Content $config_sample_file $confcontent -Encoding ASCII -Force				
		}
		
    }


    if ($serviceinfo = Get-Service "${service_name}" -ErrorAction SilentlyContinue)
    {
	    if ($serviceinfo.status -ne 'Running')
	    {
		    if ($serviceinfo.status -eq 'Stopped')
		    {
			    echo "${service_name} service found and is stopped."
			    echo "Deletinng ${service_name} Service"
			    
                Start-ChocolateyProcessAsAdmin "\\localhost delete `"${service_name}`"" "sc.exe"

                echo "Installing ${service_name} Service"
			    Start-ChocolateyProcessAsAdmin "install ${service_name} ${cmd_file}" nssm
		    }
	    }
	    else
	    {
		    echo "Stoping ${service_name} Service"
		    Start-ChocolateyProcessAsAdmin "\\localhost stop `"${service_name}`"" "sc.exe"
		    Start-ChocolateyProcessAsAdmin echo "Deleting "${service_name}" Service"
		    Start-ChocolateyProcessAsAdmin "\\localhost delete `"${service_name}`"" "sc.exe"
		    echo "Installing ${service_name} Service"
		    Start-ChocolateyProcessAsAdmin "install ${service_name} ${cmd_file}" nssm

	    }
    }
    else
    {
	    echo "No ${service_name} Service detected"
        echo "Installing ${service_name} Service"
    

	    Start-ChocolateyProcessAsAdmin "install ${service_name} ${cmd_file}" nssm
    }

    # Write-ChocolateySuccess $package_name
    
    if ($autostart_enabled)
	{
		Write-Host "Starting ${service_name}"
		Start-ChocolateyProcessAsAdmin "Start-Service ${service_name}"
	}

} catch {
    Write-ChocolateyFailure $package_name "$($_.Exception.Message)"
    throw
}
tools\chocolateyUninstall.ps1
$package_name = 'logstash'
$service_name = "Logstash"
$package_dir="c:\$package_name"

try {
    
    if ($(Get-Service "$service_name" -ErrorAction SilentlyContinue).Status -eq "Running") {
        Start-ChocolateyProcessAsAdmin "Stop-Service ${service_name} -Force"
        Start-Sleep 2
    }
    
    if ($(Get-Service "$service_name"  -ErrorAction SilentlyContinue).Status -ne "Running") {
        Write-Host "Deleting ${service_name} Service"        
		Start-ChocolateyProcessAsAdmin "\\localhost delete ${service_name}" "sc.exe"

        Write-Host "Cleaning ${package_dir} directory"
        Remove-Item -recurse $(Join-Path $package_dir "\*") -exclude *.conf, *-bak*, *-old*
    }

    Write-ChocolateySuccess $package_name
} catch {
    Write-ChocolateyFailure $package_name "$($_.Exception.Message)"
    throw
}

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Version Downloads Last Updated Status
Logstash 7.4.2 26 Monday, November 25, 2019 Approved
Logstash 6.2.4 2000 Tuesday, May 1, 2018 Approved
Logstash 5.2.1 1382 Tuesday, February 14, 2017 Approved
Logstash 5.2.0 308 Tuesday, February 14, 2017 Approved
Logstash 5.1.2 270 Tuesday, February 14, 2017 Approved
Logstash 2.3.4 917 Thursday, August 18, 2016 Approved

Discussion for the logstash Package

Ground Rules:

  • This discussion is only about logstash and the logstash package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or logstash, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus