Code Monkey home page Code Monkey logo

google-fluentd's Introduction

About

Build Status

The event collector daemon, for Treasure Data. This daemon collects various types of logs/events via various way, and transfer them to the cloud. For more about Treasure Data, see the homepage, and the documentation.

td-agent is open sourced as Fluentd project. In other words, td-agent is a distribution package of Fluentd.

td-agent package is based on Omnibus-ruby

Installation

We'll assume you have Ruby 2.7 and Bundler installed. First ensure all required gems are installed and ready to use:

$ bundle install --binstubs

Usage

Build

At first, you should download dependent gems using downloder. This is for avoding broken gem download and reduce the build time by avoiding internet access.

$ bin/gem_downloader core_gems.rb
$ bin/gem_downloader plugin_gems.rb
$ bin/gem_downloader ui_gems.rb

Create required directory and add permission

$ sudo mkdir -p /opt/td-agent /var/cache/omnibus
$ sudo chown [USER] /opt/td-agent
$ sudo chown [USER] /var/cache/omnibus

After that, you create a platform-specific package using the build project command:

$ bin/omnibus build td-agent2

The platform/architecture type of the package created will match the platform where the build project command is invoked. So running this command on say a MacBook Pro will generate a Mac OS X specific package. After the build completes packages will be available in pkg/.

Build on CentOS 5

td-agent build doesn't work on CentOS 5 by OpenSSL related issues. Follow this setup instruction before use omnibus: https://gist.github.com/repeatedly/97d4746e83a5ec135abf3eb77f46ff30

Clean

You can clean up all temporary files generated during the build process with the clean command:

$ bin/omnibus clean

Adding the --purge purge option removes ALL files generated during the build including the project install directory (/opt/td-agent) and the package cache directory (/var/cache/omnibus/pkg):

$ bin/omnibus clean --purge

Help

Full help for the Omnibus command line interface can be accessed with the help command:

$ bin/omnibus help

Build with customized plugins, files and package name

Follow steps below to build packages with customized gem lists, configuration files and original package name.

  1. make plugin list for your own environment
  • add your_plugin_gems.rb to define the plugin list for your package
  • rm plugin_gems/*
  • bin/gem_downloader your_plugin_gems.rb
  1. make your default configuration file
  • edit templates/etc/td-agent/td-agent.conf and td-agent.conf.tmpl
  1. copy config/projects/td-agent2.rb to config/projects/YOUR_PACKAGE_NAME.rb
  2. edit config/projects/YOUR_PACKAGE_NAME.rb
  • fix name, maintainer, homepage and description
  • change install_dir as /opt/YOUR_PACKAGE_NAME
  • change build_version and build_iteration
  • comment out td and td-agent-ui if you want not to install them
  1. build package by bin/omnibus build YOUR_PACKAGE_NAME
  2. test your package file

Build script generates file paths with YOUR_PACKAGE_NAME, from templates. Leave file names with td-agent in templates.

NOTE: edit project_name in Vagrantfile if required.

Vagrant-based Virtualized Build Lab

td-agent omnibus ships will a project-specific Berksfile and Vagrantfile that will allow you to build your projects on the following platforms:

  • CentOS 6 64-bit
  • CentOS 6 32-bit
  • CentOS 7 64-bit
  • Ubuntu 12.04 64-bit
  • Ubuntu 12.04 32-bit
  • Ubuntu 14.04 64-bit
  • Ubuntu 16.04 64-bit
  • Debian 7.10 64-bit
  • Debian 8.4 64-bit
  • Amazon Linux 2016.03 64-bit

Please note this build-lab is only meant to get you up and running quickly; there's nothing inherent in Omnibus that restricts you to just building CentOS or Ubuntu packages. See the Vagrantfile to add new platforms to your build lab.

The only requirements for standing up this virtualized build lab are:

The vagrant-berkshelf and vagrant-omnibus Vagrant plugins are also required and can be installed easily with the following commands:

$ vagrant plugin install vagrant-berkshelf
$ vagrant plugin install vagrant-omnibus
$ vagrant plugin install vagrant-vbguest

Exceute berks command to setup cookbooks

$ berks vendor cookbooks

Once the pre-requisites are installed you can build your package across all platforms with the following command:

$ vagrant up

If you would like to build a package for a single platform the command looks like this:

$ vagrant up PLATFORM

The complete list of valid platform names can be viewed with the vagrant status command.

Amazon Linux build

You need to install vagrant-aws 0.5.0 and add --provider option to vagrant up.

AWS_SSH_KEY_PATH=/path/to/your_aws_key_file vagrant up amazon --provider=aws

After build package, you need to copy rpm file from ec2 instances. No automatic sync for now.

pkg_build command

You can build all environments via bin/pkg_build command.

./bin/pkg_build

After that, each package is stored in td_agent2_pkg directory.

% ls td_agent2_pkg/
centos-6.7/   centos-7.2/   debian-7.10/  debian-8.4/   ubuntu-12.04/ ubuntu-14.04/ ubuntu-16.04/

Tested environment

% vagrant --version
Vagrant 1.7.4

% VBoxHeadless --version
Oracle VM VirtualBox Headless Interface 5.0.4
(C) 2008-2015 Oracle Corporation
All rights reserved.

5.0.4r102546

% ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

NOTE

Vagrant syncs current directory in each platform. Downloaded gems are also installed automatically.

And you should not use rbenv local in project root because Ruby environment is built on top of rbenv in Vagrant. So if you set different Ruby verion in .ruby-version, running ruby code will fail during pacakging process.

Kitchen-based Build Environment

Every Omnibus project ships will a project-specific Berksfile and Vagrantfile that will allow you to build your omnibus projects on all of the projects listed in the .kitchen.yml. You can add/remove additional platforms as needed by changing the list found in the .kitchen.yml platforms YAML stanza.

This build environment is designed to get you up-and-running quickly. However, there is nothing that restricts you to building on other platforms. Simply use the omnibus cookbook to setup your desired platform and execute the build steps listed above.

The default build environment requires Test Kitchen and VirtualBox for local development. Test Kitchen also exposes the ability to provision instances using various cloud providers like AWS, DigitalOcean, or OpenStack. For more information, please see the Test Kitchen documentation.

Once you have tweaked your .kitchen.yml (or .kitchen.local.yml) to your liking, you can bring up an individual build environment using the kitchen command.

$ bundle exec kitchen converge default-ubuntu-1204

Then login to the instance and build the project as described in the Usage section:

$ bundle exec kitchen login default-ubuntu-1204
[vagrant@ubuntu...] $ cd td-agent
[vagrant@ubuntu...] $ bundle install
[vagrant@ubuntu...] $ ...
[vagrant@ubuntu...] $ ./bin/omnibus build td-agent2

For a complete list of all commands and platforms, run kitchen list or kitchen help.

License

Treasure Agent package is released under the Apache2 license.

google-fluentd's People

Contributors

bmoyles0117 avatar codiverse avatar davidbtucker avatar dhrupadb avatar ekund avatar hsmatulisgoogle avatar iantalarico avatar igorpeshansky avatar jefferbrecht avatar jkohen avatar jkschulz avatar kamipo avatar kotatsu360 avatar martijnvans avatar mr-salty avatar qingling128 avatar rafaelwestphal avatar rbuskens avatar repeatedly avatar sophieyfang avatar stackdriver-instrumentation-release avatar stati0n avatar stevenycchou avatar tagomoris avatar tatsu-yam avatar thomasschickinger avatar toru-takahashi avatar willmorrison avatar y-ken avatar yyuu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-fluentd's Issues

Installed cloud logging ageng on GCE VM instance and send log to StackDriver logging, then Japanese log is not displayed

Event

I installed cloud logging agent on GCE VM instance. Sending logs to StackDriver logging is successful, however, Japanese(non-ASCII characters) logs will be disappeared on StackDriver logging. Not character corruption, only they will be empty on StackDriver logging. English logs will be displayed normally.
I checked on GCE VM instance, and then Japanese(non-ASCII characters) logs were displayed normally on the sending target log file. Are non-ASCII characters removed during sending to StackDriver? If that, I'd like to support non-ASCII characters as well.

Environment

GCE VM instance OS: Debian
cloud logging agent config like the below.

<source>
  @type tail
  format none
  path $log_path
  pos_file $pos_path
  read_from_head true
  tag $tag_name
</source>

Is it possible to upgrade version of plugin gems ?

Hi,
I haven't checked the version of all plugins though, it seems that some plugins was old compared to fluentd's version.
When I used rewrite-tag-filter plugin, I noticed its version was 1.5.5 released 3 years ago.
I think its latest one can work with fluentd version this project uses.
Is that possible to upgrade these plugins ?

Thanks.

Does not install google-fluentd on CentOS7

I have tested vanilla centos-7-v20210401 instance on GCP.
Currently always fail to installing google-fluentd.

# curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh
# bash add-logging-agent-repo.sh --also-install --verbose
Enable verbose logging.
+ REPO_HOST=packages.cloud.google.com
+ AGENT_DOCS_URL=https://cloud.google.com/logging/docs/agent
+ AGENT_SUPPORTED_URL=https://cloud.google.com/logging/docs/agent/#agent-os-list
+ AGENT_PACKAGE=google-fluentd
+ ADDITIONAL_PACKAGES=('google-fluentd-catch-all-config')
+ declare -a ADDITIONAL_PACKAGES
+ [[ -f /etc/os-release ]]
+ . /etc/os-release
++ NAME='CentOS Linux'
++ VERSION='7 (Core)'
++ ID=centos
++ ID_LIKE='rhel fedora'
++ VERSION_ID=7
++ PRETTY_NAME='CentOS Linux 7 (Core)'
++ ANSI_COLOR='0;31'
++ CPE_NAME=cpe:/o:centos:centos:7
++ HOME_URL=https://www.centos.org/
++ BUG_REPORT_URL=https://bugs.centos.org/
++ CENTOS_MANTISBT_PROJECT=CentOS-7
++ CENTOS_MANTISBT_PROJECT_VERSION=7
++ REDHAT_SUPPORT_PRODUCT=centos
++ REDHAT_SUPPORT_PRODUCT_VERSION=7
+ main --also-install --verbose
+ case "${ID:-}" in
+ handle_redhat
++ rpm --eval '%{?rhel}'
+ local MAJOR_VERSION=7
+ CODENAME=el7
+ handle_rpm
+ EXTRA_OPTS=()
+ declare -a EXTRA_OPTS
+ [[ true == \t\r\u\e ]]
+ EXTRA_OPTS+=(-v)
+ [[ add-repo also-install == *add-repo* ]]
+ resolve_version
+ [[ latest == \l\a\t\e\s\t ]]
+ AGENT_VERSION=
+ add_repo
+ lsb_release -v
+ local 'REPO_NAME=google-cloud-logging-el7-$basearch-all'
+ local 'REPO_DATA=[google-cloud-logging]
name=Google Cloud Logging Agent Repository
baseurl=https://packages.cloud.google.com/yum/repos/google-cloud-logging-el7-$basearch-all
autorefresh=0
enabled=1
type=rpm-md
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg'
+ cmp -s - /etc/yum.repos.d/google-cloud-logging.repo
+ [[ add-repo also-install == *also-install* ]]
+ install_agent
+ expected_version_installed
+ rpm -q google-fluentd google-fluentd-catch-all-config
+ return
+ yum -y list updates
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     | 6.2 kB     00:00
 * base: linux-mirrors.fnal.gov
 * epel: mirror.genesisadaptive.com
 * extras: mirror.team-cymru.com
 * updates: bay.uchicago.edu
base                                                     | 3.6 kB     00:00
extras                                                   | 2.9 kB     00:00
google-cloud-logging/x86_64/signature                    |  844 B     00:00
Retrieving key from https://packages.cloud.google.com/yum/doc/yum-key.gpg
Retrieving key from https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
google-cloud-logging/x86_64/signature                    | 1.4 kB     00:00 !!!
https://packages.cloud.google.com/yum/repos/google-cloud-logging-el7-x86_64-all/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-logging
Trying other mirror.


 One of the configured repositories failed (Google Cloud Logging Agent Repository),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=google-cloud-logging ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable google-cloud-logging
        or
            subscription-manager repos --disable=google-cloud-logging

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=google-cloud-logging.skip_if_unavailable=true

failure: repodata/repomd.xml from google-cloud-logging: [Errno 256] No more mirrors to try.
https://packages.cloud.google.com/yum/repos/google-cloud-logging-el7-x86_64-all/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-logging
+ refresh_failed yum centos
+ local REPO_TYPE=yum
+ local OS_FAMILY=centos
+ fail 'Could not refresh the google-cloud-logging yum repositories.
Please check your network connectivity and make sure you are running a supported
centos distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.'
++ date +%Y-%m-%dT%H:%M:%S%z
+ echo '[2021-04-02T05:30:56+0000] Could not refresh the google-cloud-logging yum repositories.
Please check your network connectivity and make sure you are running a supported
centos distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.'
[2021-04-02T05:30:56+0000] Could not refresh the google-cloud-logging yum repositories.
Please check your network connectivity and make sure you are running a supported
centos distribution. See https://cloud.google.com/logging/docs/agent/#agent-os-list
for a list of supported platforms.
+ exit 1

Please FIX.

Update embedded Postgres to a newer version

Hi,
Inspecting Cloud Workstations virtual machines with Wiz, it was discovered that google-fluentd component is running with Postgres 9.6.24 which is in end of life.
Based on this finding, I want to verify if there is any work in progress to update it, once running softwares in end of life can be a risk.
Thanks in advanced.

How to configure customized log name from stdout with logging agent?

Hi team,

I am using logging agent for my cloud function logging. For this serverless environment, I first use cloud logging library with redirectToStd to redirect the logging to stdout stream. Logging agent will then pick up the logs from stdout stream and send it to cloud logging API.

However, I noticed that all the logs emitted to stdout and picked up by logging agent were renamed to projects/***/logs/run.googleapis.com%2Fstdout.

Logname with logging agent (log name renamed to projects/***/logs/run.googleapis.com%2Fstdout): https://screenshot.googleplex.com/77DgGzzjp99g6fe
Logname without logging agent: https://screenshot.googleplex.com/3jaiWVbdaTFSsQU

Is there any way that I can keep my original log name as in the second screenshot when using stdout and logginga agent? Looks like I can set up tags specifically to reconfigure the logname? https://cloud.google.com/logging/docs/agent/logging/configuration

Thanks!

google-fluent silently ignores structured log entries with improper time field

Hi,
I am using google-fluentd version 1.11.2. I've noticed that google-fluentd silently ignores log entries with improper time field. Here is configuration:

<source>
  @type tail
  format json
  path /home/jenkins/workspace/*/storage/logs/*.log
  pos_file /var/lib/google-fluentd/pos/jenkins.pos
  read_from_head true

  tag jobs-logs
</source>

<filter jobs-logs*>
  @type record_transformer
  <record>
    severity ${record["severity"]}
    service "jobs"
  </record>
</filter>

Sample log entry looks like that:

{
  "log_name": "big_query",
  "message": "new request",
  "message_template": "new request",
  "time": "2020-11-23T18:57:08.694567+00:00",
  "severity": "INFO",
  "stack": {
    "thread": 140232798734080,
    "process": 6,
    "exc_info": null,
    "exc_text": null,
    "stack_info": null
  },
  "extra": {
    "req": {
      "query": "...",
      "project": "xxx",
      "params": "xxx"
    },
    "res": {
      "state": "DONE",
      "duration": 1.209,
      "latency": 1.552014112,
      "tb_billed": 1.0486e-05,
      "cost_uds": 5,
      "cache_hit": false,
      "errors": null
    },
    "extra_data": {
      "job_name": "xxx"
    }
  }
}

The problem here is probably with the time field. By default google-fluentd expects a float. However, these log entries are not visible in LogsViewer and there is no information in logs or in a verbose mode that such log entries are dropped.

When I add to the configuration that time_type string and also some (invalid for test case) time_format %Y-%-m..., then google-fluentd correctly reports that time_format is invalid.

I think google-fluentd should also report about the first situation. Without any information, it made debugging missing logs very difficult.

Logrotate causes causes tail to stop until manual service restart

Occasionally, during logrotate on a GCE CentOS 7 VM, fluentd does not restart correctly, and logs are not tailed until the service is restarted. Using stock configuration of google-fluentd.

Added a sudo systemctl restart google-fluentd to the postrotate block in the google-fluentd logrotate config. Still saw the same issue. Any help appreciated ASAP - this is causing Stackdriver logging to stop on the platform entirely unless it is manually checked daily

Problem with @type concat plugin

Hello, I'm trying to run @concat fluentd plugin which is used to combine multi-line error messages in Kubernetes cluster on GCP

Concat plugin official repo
I've tried sample code from repo documentation:

<filter **>
  @type concat
  key message
  multiline_end_regexp /\n$/
</filter>

When I applying those lines to configmap, pods gets CrashLoopBackOff and in fluentd logs there is error:

[error]: config error file="/etc/google-fluentd/google-fluentd.conf" error_class=Fluent::ConfigError error="Unknown filter plugin 'concat'. Run 'gem search -rd fluent-plugin' to find plugins" 

How to make this plugin works with fluentd on GKE? Is there any possibility to install it with gem (while spawning fluentd pods)?

NoMethodError: undefined method each

I am trying to set up the agent in my container (using debian:10.10).

Every time a message is sent it fails as follows:

fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: parsing config file is succeeded path="/etc/google-fluentd/google-fluentd.conf"
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-concat' version '2.4.0'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-detect-exceptions' version '0.0.12'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-google-cloud' version '0.12.0'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-kubernetes_metadata_filter' version '2.5.2'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-multi-format-parser' version '1.0.0'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-prometheus' version '1.4.0'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-record-modifier' version '2.0.1'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-record-reformer' version '0.9.1'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-rewrite-tag-filter' version '2.2.0'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-s3' version '1.1.10'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-systemd' version '1.0.5'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluent-plugin-webhdfs' version '1.2.3'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluentd' version '1.13.3'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: gem 'fluentd' version '1.11.5'
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: use_metadata_service is false; not detecting platform
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: using configuration file: <ROOT>
fluentd_1     |   <source>
fluentd_1     |     @type forward
fluentd_1     |   </source>
fluentd_1     |   <filter **>
fluentd_1     |     @type add_insert_ids
fluentd_1     |     @log_level "debug"
fluentd_1     |   </filter>
fluentd_1     |   <filter **>
fluentd_1     |     @type record_transformer
fluentd_1     |     enable_ruby true
fluentd_1     |     <record>
fluentd_1     |       timestamp ${ require 'time'; Time.now.utc.iso8601(3) }
fluentd_1     |     </record>
fluentd_1     |   </filter>
fluentd_1     |   <label @FLUENT_LOG>
fluentd_1     |     <match fluent.*>
fluentd_1     |       @type stdout
fluentd_1     |     </match>
fluentd_1     |   </label>
fluentd_1     |   <match my_service>
fluentd_1     |     @type google_cloud
fluentd_1     |     @log_level "debug"
fluentd_1     |     use_metadata_service false
fluentd_1     |     <buffer>
fluentd_1     |       flush_mode interval
fluentd_1     |       retry_type exponential_backoff
fluentd_1     |     </buffer>
fluentd_1     |   </match>
fluentd_1     | </ROOT>
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: starting fluentd-1.13.3 pid=33 ruby="2.6.5"
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: spawn command to main:  cmdline=["/opt/google-fluentd/embedded/bin/ruby", "-Eascii-8bit:ascii-8bit", "/usr/sbin/google-fluentd", "--under-supervisor"]
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: adding match in @FLUENT_LOG pattern="fluent.*" type="stdout"
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: adding filter pattern="**" type="add_insert_ids"
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: adding filter pattern="**" type="record_transformer"
fluentd_1     | 2021-09-08 20:55:22 +0000 [info]: adding match pattern="my_service" type="google_cloud"
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 use_metadata_service is false; not detecting platform
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: adding source type="forward"
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 starting fluentd worker pid=39 ppid=33 worker=0
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 Started the add_insert_ids plugin with logging.googleapis.com/insertId as the insert ID key.
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 Initialized the insert ID key to h43tnsm3mxde57v33.
fluentd_1     | 2021-09-08 20:55:23 +0000 [debug]: #0 buffer started instance=47011979872020 stage_size=0 queue_size=0
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 listening port port=24224 bind="0.0.0.0"
fluentd_1     | 2021-09-08 20:55:23 +0000 [info]: #0 fluentd worker is now running worker=0
fluentd_1     | 2021-09-08 20:55:23.233380300 +0000 fluent.info: {"pid":39,"ppid":33,"worker":0,"message":"starting fluentd worker pid=39 ppid=33 worker=0"}
fluentd_1     | 2021-09-08 20:55:23.233515000 +0000 fluent.info: {"message":"Started the add_insert_ids plugin with logging.googleapis.com/insertId as the insert ID key."}
fluentd_1     | 2021-09-08 20:55:23.233567900 +0000 fluent.info: {"message":"Initialized the insert ID key to h43tnsm3mxde57v33."}
fluentd_1     | 2021-09-08 20:55:23.233829700 +0000 fluent.debug: {"instance":47011979872020,"stage_size":0,"queue_size":0,"message":"buffer started instance=47011979872020 stage_size=0 queue_size=0"}
fluentd_1     | 2021-09-08 20:55:23.235076200 +0000 fluent.info: {"port":24224,"bind":"0.0.0.0","message":"listening port port=24224 bind=\"0.0.0.0\""}
fluentd_1     | 2021-09-08 20:55:23.235525200 +0000 fluent.info: {"worker":0,"message":"fluentd worker is now running worker=0"}
fluentd_1     | 2021-09-08 20:55:23 +0000 [debug]: #0 enqueue_thread actually running
fluentd_1     | 2021-09-08 20:55:23 +0000 [debug]: #0 flush_thread actually running
fluentd_1     | 2021-09-08 20:55:23.735294400 +0000 fluent.debug: {"message":"enqueue_thread actually running"}
fluentd_1     | 2021-09-08 20:55:23.736058700 +0000 fluent.debug: {"message":"flush_thread actually running"}
fluentd_1     | 2021-09-08 20:55:44 +0000 [info]: #0 disable filter chain optimization because [Fluent::Plugin::RecordTransformerFilter] uses `#filter_stream` method.
fluentd_1     | 2021-09-08 20:55:44.181471800 +0000 fluent.info: {"message":"disable filter chain optimization because [Fluent::Plugin::RecordTransformerFilter] uses `#filter_stream` method."}
fluentd_1     | 2021-09-08 20:56:46 +0000 [warn]: #0 got unrecoverable error in primary and no secondary error_class=NoMethodError error="undefined method `each' for nil:NilClass"
fluentd_1     | 2021-09-08 20:56:46.303820400 +0000 fluent.warn: {"error":"#<NoMethodError: undefined method `each' for nil:NilClass>","message":"got unrecoverable error in primary and no secondary error_class=NoMethodError error=\"undefined method `each' for nil:NilClass\""}
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:49:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:48:in `tap'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:48:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:19:in `evaluate'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:10:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `inject'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:50:in `compile_fragment'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:14:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:68:in `representable_map!'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:56:in `create_representation_with'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/hash.rb:37:in `to_hash'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/serializer.rb:45:in `block in <module:Representable>'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:19:in `evaluate'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:10:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `inject'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:50:in `compile_fragment'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:14:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:68:in `representable_map!'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:56:in `create_representation_with'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/hash.rb:37:in `to_hash'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/serializer.rb:45:in `block in <module:Representable>'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:19:in `evaluate'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:10:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `inject'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:40:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:39:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:39:in `each_with_index'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:39:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:19:in `evaluate'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:10:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `inject'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/pipeline.rb:9:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:50:in `compile_fragment'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:14:in `block in call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `each'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/binding.rb:12:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:68:in `representable_map!'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable.rb:56:in `create_representation_with'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/hash.rb:37:in `to_hash'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/representable-3.1.1/lib/representable/json.rb:42:in `to_json'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/google-api-client-0.30.8/lib/google/apis/core/api_command.rb:64:in `prepare!'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/google-api-client-0.30.8/lib/google/apis/core/http_command.rb:99:in `execute'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/google-api-client-0.30.8/lib/google/apis/core/base_service.rb:360:in `execute_or_queue_command'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/google-api-client-0.30.8/generated/google/apis/logging_v2/service.rb:695:in `write_entry_log_entries'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-google-cloud-0.12.0/lib/fluent/plugin/out_google_cloud.rb:1013:in `write_request_via_rest'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-google-cloud-0.12.0/lib/fluent/plugin/out_google_cloud.rb:789:in `call'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-google-cloud-0.12.0/lib/fluent/plugin/out_google_cloud.rb:789:in `write'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/compat/output.rb:131:in `write'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin/output.rb:1138:in `try_flush'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin/output.rb:1450:in `flush_thread_run'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin/output.rb:462:in `block (2 levels) in start'
fluentd_1     |   2021-09-08 20:56:46 +0000 [warn]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
fluentd_1     | 2021-09-08 20:56:46 +0000 [warn]: #0 bad chunk is moved to /tmp/fluent/backup/worker0/object_2ac1d4592dcc/5cb821b1644efb700543127c4850c620.log
fluentd_1     | 2021-09-08 20:56:46.305762500 +0000 fluent.warn: {"message":"bad chunk is moved to /tmp/fluent/backup/worker0/object_2ac1d4592dcc/5cb821b1644efb700543127c4850c620.log"}

Am I missing something in the config here? Would appreciate any feedback.

Service failed after upgrade

Since the service upgrade this morning, from version 1.8.5-1 to 1.8.5-1 (somehow), the service won't start again. Even after purging and deleting all configuration and pos files, the service start crashes. Exit-code is 203.

Dec 02 10:09:21 ***** systemd[1]: Starting google-fluentd.service...
-- Subject: Unit google-fluentd.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit google-fluentd.service has begun starting up.
Dec 02 10:09:21 grutte-apier-web01 systemd[21109]: google-fluentd.service: Failed to execute command: Exec format error
Dec 02 10:09:21 grutte-apier-web01 systemd[21109]: google-fluentd.service: Failed at step EXEC spawning /etc/init.d/google-fluentd: Exec format error
-- Subject: Process /etc/init.d/google-fluentd could not be executed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The process /etc/init.d/google-fluentd could not be executed and failed.
-- 
-- The error number returned by this process is 8.
Dec 02 10:09:21 grutte-apier-web01 systemd[1]: google-fluentd.service: Control process exited, code=exited status=203
Dec 02 10:09:21 grutte-apier-web01 systemd[1]: google-fluentd.service: Failed with result 'exit-code'.
Dec 02 10:09:21 grutte-apier-web01 systemd[1]: Failed to start google-fluentd.service.
-- Subject: Unit google-fluentd.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit google-fluentd.service has failed.
-- 
-- The result is RESULT.

unexpected error error_class=ArgumentError error="wrong number of arguments ( given 2, expected 1; required keyword: docstring)"

Since upgrading to the latest version google-fluentd we see the service starting/crashing continuously stack trace:

  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/root_agent.rb:191:in `each'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/root_agent.rb:191:in `block in lifecycle'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/root_agent.rb:178:in `each'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/root_agent.rb:178:in `lifecycle'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/root_agent.rb:202:in `start'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/engine.rb:274:in `start'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/engine.rb:219:in `run'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/supervisor.rb:808:in `run_engine'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/supervisor.rb:551:in `block in run_worker'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/supervisor.rb:733:in `main_process'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/supervisor.rb:546:in `run_worker'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/lib/flu
ent/command/fluentd.rb:320:in `<top (required)>'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/ker
nel_require.rb:54:in `require'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/ker
nel_require.rb:54:in `require'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.5.0/gems/fluentd-1.6.3/bin/flu
entd:8:in `<top (required)>'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/bin/fluentd:23:in `load'
  2019-10-13 10:48:53 +0000 [error]: #0 /opt/google-fluentd/embedded/bin/fluentd:23:in `<top (required)>'
  2019-10-13 10:48:53 +0000 [error]: #0 /usr/sbin/google-fluentd:7:in `load'
  2019-10-13 10:48:53 +0000 [error]: #0 /usr/sbin/google-fluentd:7:in `<main>'
2019-10-13 10:48:53 +0000 [error]: #0 unexpected error error_class=ArgumentError error="wrong number of arguments (
given 2, expected 1; required keyword: docstring)"
  2019-10-13 10:48:53 +0000 [error]: #0 suppressed same stacktrace

Add support for Amazon Linux 2

Currently installation to Amazon Linux2 fails with

**sudo bash install-monitoring-agent.sh**

==============================================================================
Starting installation of stackdriver-agent
==============================================================================

Installing agent for Amazon Linux.
Importing GPG key 0xA7317B0F:
 Userid     : "Google Cloud Packages Automatic Signing Key <[email protected]>"
 Fingerprint: d0bc 747f d8ca f711 7500 d6fa 3746 c208 a731 7b0f
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/repos/google-cloud-monitoring-amzn-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-monitoring
Trying other mirror.


 One of the configured repositories failed (Google Cloud Monitoring Agent Repository),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=google-cloud-monitoring ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable google-cloud-monitoring
        or
            subscription-manager repos --disable=google-cloud-monitoring

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=google-cloud-monitoring.skip_if_unavailable=true

failure: repodata/repomd.xml from google-cloud-monitoring: [Errno 256] No more mirrors to try.
https://packages.cloud.google.com/yum/repos/google-cloud-monitoring-amzn-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-monitoring
Importing GPG key 0xA7317B0F:
 Userid     : "Google Cloud Packages Automatic Signing Key <[email protected]>"
 Fingerprint: d0bc 747f d8ca f711 7500 d6fa 3746 c208 a731 7b0f
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg

Importing GPG key 0xBA07F4FB:
 Userid     : "Google Cloud Packages Automatic Signing Key <[email protected]>"
 Fingerprint: 54a6 47f9 048d 5688 d7da 2abe 6a03 0b21 ba07 f4fb
 From       : https://packages.cloud.google.com/yum/doc/yum-key.gpg

https://packages.cloud.google.com/yum/repos/google-cloud-monitoring-amzn-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-monitoring
Trying other mirror.


 One of the configured repositories failed (Google Cloud Monitoring Agent Repository),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=google-cloud-monitoring ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable google-cloud-monitoring
        or
            subscription-manager repos --disable=google-cloud-monitoring

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=google-cloud-monitoring.skip_if_unavailable=true

failure: repodata/repomd.xml from google-cloud-monitoring: [Errno 256] No more mirrors to try.
https://packages.cloud.google.com/yum/repos/google-cloud-monitoring-amzn-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for google-cloud-monitoring
Redirecting to /bin/systemctl restart stackdriver-agent.service
Failed to restart stackdriver-agent.service: Unit not found.

==============================================================================
Errors occurred while installing stackdriver-agent-Is this ok [y/N]: Is this ok [y/N]: Retrieving key from https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg. See the log snippet
above or run:
  sudo service stackdriver-agent status

Please consult the documentation for troubleshooting advice:
  https://cloud.google.com/monitoring/agent

You can monitor the monitoring agent's logfile at:
  /var/log/messages
==============================================================================```

Installing DataDog logging plugin to embedded ruby gems directory

We run google-fluentd and trying to install the DataDog plugin (https://github.com/DataDog/fluent-plugin-datadog) to ship logs to DataDog. Their install simply says to run:

gem install fluent-plugin-datadog

However, this installs the fluentd plugin in the system level ruby gems directory /var/lib/gems/2.3.0/gems which the embedded version of Ruby that ships with google-fluentd /opt/google-fluentd/embedded/bin/ruby does not pickup.

ps aux | grep "google-fluentd"
root     13967  0.0  2.4 162160 51076 ?        Sl   Oct22   2:04 /opt/google-fluentd/embedded/bin/ruby /usr/sbin/google-fluentd --log /var/log/google-fluentd/google-fluentd.log --daemon /var/run/google-fluentd/google-fluentd.pid
root     13972  0.3  4.5 291644 93272 ?        Sl   Oct22  34:11 /opt/google-fluentd/embedded/bin/ruby -Eascii-8bit:ascii-8bit /usr/sbin/google-fluentd --log /var/log/google-fluentd/google-fluentd.log --daemon /var/run/google-fluentd/google-fluentd.pid --under-supervisor
justin2  29970  0.0  0.0  12784   984 pts/0    S+   21:36   0:00 grep google-fluentd

How can we install the DataDog logging plugin to our google-fluentd?

After Log rotate google fluentd process is not running

Hi

I have noticed sometimes after the google-fluentd.log file is rotated , google-fluent process does not start and i see a file
-rw-r----- 1 google-fluentd root 0 Mar 22 04:59 google-fluentd.log
This is the logrotate file

/var/log/google-fluentd/google-fluentd.log {
daily
rotate 30
compress
delaycompress
notifempty
create 640 google-fluentd google-fluentd
sharedscripts
postrotate
pid=/var/run/google-fluentd/google-fluentd.pid
test -s $pid &amp;&amp; kill -USR1 "$(cat $pid)"
endscript
}
i tried changing postrotate to
postrotate
service google-fluentd stop
sleep 125
service google-fluentd start
but it gets overwritten to the default post rotate.

Plz advise

Can google-fluentd send logs to stackdriver(default) and my own elasticsearch server?

Hi team
I want to collect logs and display some data on graph.but I can see below configurations on /etc/google-fluentd/google-fluentd.conf.how can I configurate to add one destination for the logs?

<match **>
  @type google_cloud
  buffer_chunk_limit 1M

  flush_interval 5s

  disable_retry_limit false

  retry_limit 3

  retry_wait 10

  max_retry_wait 300

  num_threads 8

  use_grpc true

  partial_success true

  enable_monitoring true
  monitoring_type prometheus

</match>

A lot of spam in syslog

After updating google-fluentd from 1.6.4-1 version to google-fluentd 1.6.12-1 on Ubuntu 18.04, we got a lot of messages in syslog like this:

collectd[1463]: parse_value: Ignoring trailing garbage ".0" after derive value. Input string was "**21.0**".
collectd[1463]: parse_value: Ignoring trailing garbage ".0" after derive value. Input string was "**780.0**".

I found out, that periodicity depends on stackdriver-agent config, by default every 60 Seconds and related with stackdriver-agent exec plugin:

<Plugin "exec">
  Exec "nobody" "/opt/stackdriver/collectd/bin/stackdriver-read_agent_logging" "curl http://localhost:24231/metrics"
</Plugin>

When I check this page by curl

curl http://localhost:24231/metrics

I just realized what data from my example equal to values on that page
Input string was "21.0" = stackdriver_successful_requests_count
Input string was "780.0" = stackdriver_ingested_entries_count

If stackdriver-agent or google-fluentd is stopped - there no messages like this in syslog but when they working together we see this messages every minute.

unexpected error error_class=SignalException error="SIGHUP"

Hi!

Seems that the Ruby update to 2.6.x caused a problem when you try to run systemctl reload google-fluentd. We get this error with the latest google-fluentd releases:

2020-01-21 00:00:05 +0000 [error]: unexpected error error_class=SignalException error="SIGHUP"
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/engine.rb:228:in `sleep'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/engine.rb:228:in `run'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/supervisor.rb:808:in `run_engine'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/supervisor.rb:551:in `block in run_worker'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/supervisor.rb:733:in `main_process'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/supervisor.rb:546:in `run_worker'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/command/fluentd.rb:320:in `<top (required)>'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/bin/fluentd:8:in `<top (required)>'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/bin/fluentd:23:in `load'
  2020-01-21 00:00:05 +0000 [error]: /opt/google-fluentd/embedded/bin/fluentd:23:in `<top (required)>'
  2020-01-21 00:00:05 +0000 [error]: /usr/sbin/google-fluentd:7:in `load'
  2020-01-21 00:00:05 +0000 [error]: /usr/sbin/google-fluentd:7:in `<main>'
2020-01-21 00:00:05 +0000 [warn]: thread doesn't exit correctly (killed or other reason) plugin=Fluent::Plugin::TailInput title=:event_loop thread=#<Thread:0x0000000002b8a860@/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.6.3/lib/fluent/plugin_helper/thread.rb:70 aborting> error=nil

google-fluentd works fine until you run systemctl reload google-fluentd. In contrast systemctl restart google-fluentd works fine. Currently installed is google-fluentd:1.6.27-1. google-fluentd :1.6.14-1 worked without this issue.

This affects the GCP images ubuntu-1804-bionic-v20200108 and ubuntu-1804-bionic-v20191113. It worked without issue with ubuntu-1804-bionic-v20191021 and older images.

unable to install google-fluentd on debian arm64

Hi,
I am trying to install google fluentd on debian arm64 AWS EC2 instance and it complains as below
Package google-fluentd is not available, but is referred to by another package.
It works fine on non arm instance though.
I followed this link ->https://cloud.google.com/logging/docs/agent/logging/installation
uname -a Linux ip-10-139-81-194 4.19.0-21-arm64 #1 SMP Debian 4.19.249-2 (2022-06-30) aarch64 GNU/Linux

i tried to put [arch=arm64] option as well but still fails.
cat /etc/apt/sources.list.d/google-cloud-logging.list deb [arch=arm64] https://packages.cloud.google.com/apt google-cloud-logging-buster-all main

cat /etc/apt/sources.list.d/google-cloud-logging.list
deb https://packages.cloud.google.com/apt google-cloud-logging-buster-all main

Help would be appreciated :)

Wrong socket permission since 1.6.27

Ever since Jan 14 google-fluentd fails to set proper permission on unix socket created by @type unix source:

$ ls -l /var/run/google-fluentd/google-fluentd.sock
srwxr-xr-x 1 root root 0 Jan 14 04:28 /var/run/google-fluentd/google-fluentd.sock
$ cat /etc/google-fluentd/config.d/socket.conf
<source>
  @type unix
  path /var/run/google-fluentd/google-fluentd.sock
</source>

This looks similar to fluent/fluentd#1019

openssl.so fails to find EC_GROUP_new_curve_GF2m in libcrypto.so.1.1

I created an image of a machine modified from GCP image sles-15-sp2-sap-v20220718-x86-64, and google-fluentd is having library issues. I've managed to reproduce it once with just the base image + installing google-fluentd, but that instance has since spontaneously fixed itself. The original image is still having problems. As a workaround, I've downgraded to google-fluentd=1.9.8-1.sles15

OS info:

> cat /etc/os-release
NAME="SLES"
VERSION="15-SP2"
VERSION_ID="15.2"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp2"
VARIANT_ID="sles-sap"

Here's the error message from journalctl:

Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]: Starting google-fluentd 1.9.9: /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': /opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/openssl.so: symbol EC_GROUP_new_curve_GF2m, version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference - /opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/openssl.so (LoadError)
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/openssl.rb:13:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin_helper/server.rb:24:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin_helper/http_server.rb:26:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin_helper.rb:25:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/plugin/filter.rb:22:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/compat/filter.rb:18:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/filter.rb:17:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/event_router.rb:19:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/engine.rb:19:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/supervisor.rb:23:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/lib/fluent/command/fluentd.rb:19:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluentd-1.13.3/bin/fluentd:15:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/bin/fluentd:23:in `load'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /opt/google-fluentd/embedded/bin/fluentd:23:in `<top (required)>'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /usr/sbin/google-fluentd:7:in `load'
Aug 29 13:36:46 n-sles15-03 google-fluentd[13586]:         from /usr/sbin/google-fluentd:7:in `<main>'

I set the environment variables "LD_DEBUG=all" and "LD_DEBUG_OUTPUT=/tmp/fluentd_ld" to see what library was being loaded, these are the lines for the failure:

     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/bin/ruby [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/libruby.so.2.6 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/libz.so.1 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/libpthread.so.0 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/librt.so.1 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/libdl.so.2 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/libcrypt.so.1 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/libm.so.6 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/libc.so.6 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/enc/encdb.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/enc/trans/transdb.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/stringio.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/etc.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/json-2.2.0/lib/json/ext/parser.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/json-2.2.0/lib/json/ext/generator.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/yajl-ruby-1.3.1/lib/yajl/yajl.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/socket.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/io/wait.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/ripper.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/strscan.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/cool.io-1.6.0/lib/iobuffer_ext.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/cool.io-1.6.0/lib/cool.io_ext.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/msgpack-1.5.4/lib/msgpack/msgpack.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/date_core.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/strptime-0.2.5/lib/strptime/strptime.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/bigdecimal.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/oj-3.3.10/lib/oj/oj.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/zlib.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/io/nonblock.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/cgi/escape.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/digest/md5.so [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/usr/lib64/libssl.so.1.1 [0]
     23929:     symbol=EC_GROUP_new_curve_GF2m;  lookup in file=/usr/lib64/libcrypto.so.1.1 [0]
     23929:     /opt/google-fluentd/embedded/lib/ruby/2.6.0/x86_64-linux/openssl.so: error: relocation error: symbol EC_GROUP_new_curve_GF2m, version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference (fatal)

Looking through the file for why libcrypto.so.1.1 was loaded, I found these lines:

     23929:     symbol=initgroups;  lookup in file=/sbin/start_daemon [0]
     23929:     symbol=initgroups;  lookup in file=/usr/lib64/libblogger.so.2 [0]
     23929:     symbol=initgroups;  lookup in file=/lib64/libpthread.so.0 [0]
     23929:     symbol=initgroups;  lookup in file=/lib64/libc.so.6 [0]
     23929:     binding file /sbin/start_daemon [0] to /lib64/libc.so.6 [0]: normal symbol `initgroups' [GLIBC>
     23929:     symbol=_nss_files_initgroups_dyn;  lookup in file=/lib64/libnss_files.so.2 [0]
     23929:     binding file /lib64/libnss_files.so.2 [0] to /lib64/libnss_files.so.2 [0]: normal symbol `_nss>
     23929:
     23929:     file=libnss_cache_oslogin.so.2 [0];  dynamically loaded by /lib64/libc.so.6 [0]
     23929:     find library=libnss_cache_oslogin.so.2 [0]; searching
     23929:      search cache=/etc/ld.so.cache
     23929:       trying file=/usr/lib64/libnss_cache_oslogin.so.2
...
     23929:     file=libcurl.so.4 [0];  needed by /usr/lib64/libnss_cache_oslogin.so.2 [0]
     23929:     find library=libcurl.so.4 [0]; searching
     23929:      search cache=/etc/ld.so.cache
     23929:       trying file=/usr/lib64/libcurl.so.4
...
     23929:     file=libcrypto.so.1.1 [0];  needed by /usr/lib64/libcurl.so.4 [0]
     23929:     find library=libcrypto.so.1.1 [0]; searching
     23929:      search cache=/etc/ld.so.cache
     23929:       trying file=/usr/lib64/libcrypto.so.1.1

As far as I can tell, it seems like google-fluentd is using the system libcrypto.so.1.1 instead of the one it ships with, and the one it ships with has extra symbols:

> readelf --wide -s /opt/google-fluentd/embedded/lib/libcrypto.so.1.1 | grep EC_GROUP_new_curve
  3718: 000000000010a6a0    92 FUNC    GLOBAL DEFAULT   14 EC_GROUP_new_curve_GFp@@OPENSSL_1_1_0
  3977: 000000000010a700    92 FUNC    GLOBAL DEFAULT   14 EC_GROUP_new_curve_GF2m@@OPENSSL_1_1_0
  7024: 000000000010a6a0    92 FUNC    GLOBAL DEFAULT   14 EC_GROUP_new_curve_GFp
  7075: 000000000010a700    92 FUNC    GLOBAL DEFAULT   14 EC_GROUP_new_curve_GF2m
> readelf --wide -s /usr/lib64/libcrypto.so.1.1 | grep EC_GROUP_new_curve
  3743: 000000000010f100    92 FUNC    GLOBAL DEFAULT   14 EC_GROUP_new_curve_GFp@@OPENSSL_1_1_0

I think this wasn't a problem in google-fluentd=1.9.8-1.sles15 because the google-fluentd's libcrypto was libcrypto.so.1.0.0, which the system doesn't have.

Checking the LD_DEBUG=all output for google-fluentd=1.9.9-1.sles15 on a system that isn't having problems, it seems like libnss isn't being loaded. I'm not sure why, I ensured /etc/nsswitch.conf was the same on the passing and failing systems, and they continued to pass/fail.

google-fluentd container as a k8s pod sidecar error: labels is incomplete

When running a google-fluentd container as a Kubernetes pod sidecar with image gcr.io/stackdriver-agents/stackdriver-logging-agent:1.7.1 and emptyDir: {} mounted to scrape logs I'm getting this error:

Unable to export to Monitoring service because: GaxError RPC failed, caused by 3:One or more TimeSeries could not be written: The set of resource labels is incomplete. Missing labels: (container_name namespace_id pod_id).: timeSeries[0-2]. debug_error_string:{"created":"@1597236685.224168876","description":"Error received from peer ipv4:[REDACTED]:443","file":"src/core/lib/surface/call.cc","file_line":1055,"grpc_message":"One or more TimeSeries could not be written: The set of resource labels is incomplete. Missing labels: (container_name namespace_id pod_id).: timeSeries[0-2]","grpc_status":3}

Full log, including current Google-fluentd configuration, is here:
https://gist.githubusercontent.com/voxmaster/93fba5ec0912dbc1e150d0bb165eef92/raw/254f46f402e7d6fe7f1c6ce7fd0b81d39d585aec/google-fluentd%2520sidecar

Appreciate any advice. Thanks!

Logging errors after 24 hours

Steps to reproduce

  1. Create a VM in a project with a properly authorized service account
  2. Install google-fluentd on the VM using
curl -sSO https://dl.google.com/cloudagents/add-logging-agent-repo.sh
sudo bash add-logging-agent-repo.sh --also-install
  1. Wait for 24 hours
  2. Look for monitoring errors like Field timeSeries[0].points[0].interval.end_time had an invalid value of \"2021-07-26T11:36:33.148228-07:00\": Data points cannot be written more than 24h in the past.

The errors look like the following:

{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "code": 3,
      "message": "Field timeSeries[0].points[0].interval.end_time had an invalid value of \"2021-07-26T11:36:33.148228-07:00\": Data points cannot be written more than 24h in the past."
    },
    "authenticationInfo": {
      "principalEmail": "[email protected]",
      "serviceAccountDelegationInfo": [
        {
          "firstPartyPrincipal": {
            "principalEmail": "[email protected]"
          }
        }
      ]
    },
    "requestMetadata": {
      "callerIp": "34.126.189.144",
      "callerSuppliedUserAgent": "grpc-ruby/1.31.1 grpc-c/11.0.0 (linux; chttp2),gzip(gfe)",
      "callerNetwork": "//compute.googleapis.com/projects/my-project/global/networks/__unknown__",
      "requestAttributes": {
        "time": "2021-07-29T02:26:33.235770889Z",
        "auth": {}
      },
      "destinationAttributes": {}
    },
    "serviceName": "monitoring.googleapis.com",
    "methodName": "google.monitoring.v3.MetricService.CreateTimeSeries",
    "authorizationInfo": [
      {
        "resource": "1013889007580",
        "permission": "monitoring.timeSeries.create",
        "granted": true,
        "resourceAttributes": {}
      }
    ],
    "resourceName": "projects/my-project",
    "request": {
      "name": "projects/my-project",
      "@type": "type.googleapis.com/google.monitoring.v3.CreateTimeSeriesRequest"
    }
  },
  "insertId": "1kvwplie9or15",
  "resource": {
    "type": "audited_resource",
    "labels": {
      "service": "monitoring.googleapis.com",
      "method": "google.monitoring.v3.MetricService.CreateTimeSeries",
      "project_id": "my-project"
    }
  },
  "timestamp": "2021-07-29T02:26:33.229921701Z",
  "severity": "ERROR",
  "logName": "projects/my-project/logs/cloudaudit.googleapis.com%2Fdata_access",
  "receiveTimestamp": "2021-07-29T02:26:34.004532362Z"
}

Running the google-fluentd service with debugging enabled only yieds this from /var/log/google-fluentd/google-fluentd.log

2021-07-27 21:15:43 +0000 [debug]: #0 calling monitoring.googleapis.com:443:/google.monitoring.v3.MetricService/CreateTimeSeries
2021-07-27 21:15:43 +0000 [debug]: #0 Failing with status #<struct Struct::Status code=3, details="Field timeSeries[0].points[0].interval.end_time had an invalid value of \"2021-07-26T14:14:43.007882-07:00\": Data points cannot be written more than 24h in the past.", metadata={}, debug_error_string="{\"created\":\"@1627420543.076323077\",\"description\":\"Error received from peer ipv4:142.250.128.95:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":1062,\"grpc_message\":\"Field timeSeries[0].points[0].interval.end_time had an invalid value of \"2021-07-26T14:14:43.007882-07:00\": Data points cannot be written more than 24h in the past.\",\"grpc_status\":3}">

It appears that the new ops-agent does not have this issue, which suggests that it's not due to any project/org level settings.

No way to specify GOOGLE_APPLICATION_CREDENTIALS before install

There doesn't appear to be a way to specify the GOOGLE_APPLICATION_CREDENTIALS environment variable before installing the deb package, so the installation always fails with on-prem servers because it attempts to start the google-fluentd during the install.

I've been able to hack around this by ignoring the error, inserting the variable to the /etc/init.d/google-fluentd script, restarting the service, and then completing the installation with apt-get install -f.

This still slows down the deployment significantly as there's a series of retries before the initial install eventually fails, and makes my deployment automation much more complicated than it should be.

google-fluentd not shipping logs to gcp logging on EC2 ubuntu with IMDSv2(Instance metadata service v2)

Hello

google-fluentd not shipping logs to gcp logging on EC2 ubuntu with IMDSv2(Instance metadata service v2)

Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal

google-fluentd 1.8.4-1
google-fluentd-catch-all-config-structured 1.0

Following error logs I was able to find in fluentd logs

2021-03-19 06:47:57 +0000 [error]: Failed to access metadata service: error_class=OpenURI::HTTPError error="401 Unauthorized"
2021-03-19 06:47:57 +0000 [info]: Unable to determine platform

Where is td-agent2.rb config file?

# bin/omibus build td-agent2

I could not find a project named td-agent2 in any of the project locations:

google-fluentd/config/projects

so where is td-agent2 config is?

google-fluentd official docker image

Is there any chance that google-fluentd will be distributed in public Container Registry (like Docker Hub or gcr.io) to use it as a sidecar in GKE for example? Tried to find one, but all I see is only individual projects without any official support. Maybe there is an alternative way or workaround? Please share some info.

Memory leak in ruby process?

I had one of these killed recently by the linux OOM killer โ€“ after 87 days running on the google cloud:

[7595615.399139] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=b9bd611bc9ee699608d0bfe919b90f987e94e924fbf57748f078433c8c4b1e20,mems_allowed=0,global_oom,task_memcg=/docker/b9bd611bc9ee699608d0bfe919b90f987e94e924fbf57748f078433c8c4b1e20,task=ruby,pid=1237,uid=0
[7595615.424623] Out of memory: Killed process 1237 (ruby) total-vm:1254608kB, anon-rss:614712kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:1940kB oom_score_adj:0
[7595615.528767] oom_reaper: reaped process 1237 (ruby), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

There seems to be a memory leak somewhere.

Lastest google-fluentd (1.8.9) has old google-api-client-0.30.8

Latest google-fluentd (1.8.9) still has the old google-api-client-0.30.8 included, which conflicts with other plugins:

Unable to activate google-api-client-0.30.8, because googleauth-0.16.2 conflicts with googleauth (>= 0.5, < 0.10.0) (Gem::ConflictError)

Some background: I installed GCS output plugin google-fluentd-gem install fluent-plugin-gcs which pulls some other gems:
Successfully installed googleauth-0.16.2
Successfully installed google-apis-core-0.3.0
Successfully installed google-apis-iamcredentials_v1-0.3.0
Successfully installed google-apis-storage_v1-0.3.0

Fluentd keeps crashing on GKE 1.16

looks like related to version 2.4.5 of fluent-plugin-kubernetes_metadata_filter

the error is as follows:

#<Thread:0x0000000002e2bc40@/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/filter_kubernetes_metadata.rb:277 run> terminated with exception (report_on_exception is true):
/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:43:in `rescue in set_up_namespace_thread': undefined method `<' for nil:NilClass (NoMethodError)
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:38:in `set_up_namespace_thread'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/filter_kubernetes_metadata.rb:277:in `block in configure'
/opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:127:in `block in process_namespace_watcher_notices': Error while watching namespaces: too old resource version: 73764561 (73772817) (RuntimeError)
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/kubeclient-4.6.0/lib/kubeclient/watch_stream.rb:28:in `block in each'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/http-4.4.0/lib/http/response/body.rb:37:in `each'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/kubeclient-4.6.0/lib/kubeclient/watch_stream.rb:25:in `each'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:107:in `process_namespace_watcher_notices'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:40:in `set_up_namespace_thread'
        from /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/filter_kubernetes_metadata.rb:277:in `block in configure'
2020-06-23 12:03:17 +0000 [error]: #0 unexpected error error_class=NoMethodError error="undefined method `<' for nil:NilClass"
  2020-06-23 12:03:17 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:43:in `rescue in set_up_namespace_thread'
  2020-06-23 12:03:17 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb:38:in `set_up_namespace_thread'
  2020-06-23 12:03:17 +0000 [error]: #0 /opt/google-fluentd/embedded/lib/ruby/gems/2.6.0/gems/fluent-plugin-kubernetes_metadata_filter-2.4.5/lib/fluent/plugin/filter_kubernetes_metadata.rb:277:in `block in configure'
2020-06-23 12:03:18 +0000 [info]: Worker 0 finished unexpectedly with status 1

its seems as a known issue here fabric8io/fluent-plugin-kubernetes_metadata_filter#226 and they have reverted to release 2.4.1

thanks

FreeBSD support

Any chance that this will be packaged for FreeBSD at some point?

If not, is there any way to manually get something like this working on FreeBSD. i.e., sending system & application logs to Stackdriver Logging?

automatice.yml

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

๐Ÿ“ Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

โ„น๏ธ Googlers: Go here for more info.

Originally posted by @google-cla[bot] in #333 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.