Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Missing context in loglines #16

Open
dforste opened this issue Jun 24, 2015 · 3 comments · May be fixed by #17
Open

Missing context in loglines #16

dforste opened this issue Jun 24, 2015 · 3 comments · May be fixed by #17

Comments

@dforste
Copy link
Contributor

dforste commented Jun 24, 2015

Can context be given to these puppet reports? The log line "created" is not informative of what actually happened. Here is an example puppet-report:

{
  "_index": "logstash-2015.06.24",
  "_type": "puppet-report",
  "_id": "AU4jxC9F7LhM2aXYJcda",
  "_score": null,
  "_source": {
    "metrics": {
      "events": {
        "total": 1,
        "success": 1,
        "failure": 0
      },
      "changes": {
        "total": 1
      },
      "time": {
        "service": 0.97635,
        "mailalias": 0.000373,
        "filebucket": 0.000157,
        "cron": 0.001031,
        "archive": 0.002056,
        "file_line": 0.00372,
        "config_retrieval": 10.188266992569,
        "concat_fragment": 0.000593,
        "concat_build": 0.004273,
        "anchor": 0.001959,
        "group": 0.004156,
        "exec": 1.304689,
        "total": 18.026579992569,
        "package": 1.818483,
        "datacat_collector": 0.010259,
        "ssh_authorized_key": 0.000465,
        "resources": 0.000174,
        "yumrepo": 0.015681,
        "file": 2.008586,
        "datacat_fragment": 0.00612,
        "augeas": 1.618968,
        "user": 0.0586100000000001,
        "host": 0.00161
      },
      "resources": {
        "restarted": 0,
        "out_of_sync": 1,
        "changed": 1,
        "total": 295,
        "failed_to_restart": 0,
        "failed": 0,
        "skipped": 0,
        "scheduled": 0
      }
    },
    "end_time": "2015-06-24T04:12:15Z",
    "puppet_version": "3.7.4",
    "report_format": 4,
    "logs": [
      "Retrieving pluginfacts",
      "Retrieving plugin",
      "Loading facts",
      "Caching catalog for host1.example.com",
      "Applying configuration version '940f1d9f99d4a0cb8f375fd546ebca1e061e73ac'",
      "created",
      "Finished catalog run in 11.18 seconds"
    ],
    "environment": "production",
    "message": "Puppet run on host1.example.com changed",
    "@timestamp": "2015-06-24T04:12:16.000Z",
    "status": "changed",
    "tags": [
      "puppet-apply",
      "elasticsearch"
    ],
    "@version": 1,
    "start_time": "2015-06-24T04:11:47Z",
    "host": "host1.example.com",
    "type": "puppet-report"
  },
  "fields": {
    "end_time": [
      1435119135000
    ],
    "start_time": [
      1435119107000
    ],
    "@timestamp": [
      1435119136000
    ]
  },
  "sort": [
    1435119136000
  ]
}
@electrical
Copy link

Hi,

Thanks for reporting this!
its weird its not giving more data for you on the log lines part.
Will do some checking on this.

@dforste dforste linked a pull request Jul 2, 2015 that will close this issue
@dforste
Copy link
Contributor Author

dforste commented Jul 2, 2015

My PR seems to produce better but not optimal output.

Example:

{
    "host": "server1.example.net",
    "logs": [
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Retrieving pluginfacts"
                },
                "level": "info"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Retrieving plugin"
                },
                "level": "info"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Loading facts"
                },
                "level": "info"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Caching catalog for server1.example.net"
                },
                "level": "info"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Applying configuration version '14892238e0aef552e223b9fbd976816290a7c7af'"
                },
                "level": "info"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[optional]/File[/etc/yum.repos.d/optional.repo]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be file (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[latest]/File[/etc/yum.repos.d/latest.repo]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be file (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[latest]/Yumrepo[latest]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be present (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Yum::Managed_yumrepo[latest]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 2 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[optional]/Yumrepo[optional]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be present (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Yum::Managed_yumrepo[optional]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 2 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[base]/File[/etc/yum.repos.d/base.repo]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be file (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[base]/Yumrepo[base]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be present (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Yum::Managed_yumrepo[base]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 2 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[supplementary]/File[/etc/yum.repos.d/supplementary.repo]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be file (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[supplementary]/Yumrepo[supplementary]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be present (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[updates]/File[/etc/yum.repos.d/updates.repo]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be file (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "/Stage[pre-main]/Yum::Repo::Redhat/Yum::Managed_yumrepo[updates]/Yumrepo[updates]/ensure"
                },
                "messages": {
                    "message": "current_value absent, should be present (noop)"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Yum::Managed_yumrepo[updates]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 2 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Yum::Managed_yumrepo[supplementary]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 2 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Class[Yum::Repo::Redhat]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 5 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Stage[pre-main]"
                },
                "messages": {
                    "message": "Would have triggered 'refresh' from 1 events"
                },
                "level": "notice"
            }
        },
        {
            "log": {
                "sources": {
                    "source": "Puppet"
                },
                "messages": {
                    "message": "Finished catalog run in 9.38 seconds"
                },
                "level": "notice"
            }
        }
    ],
    "status": "unchanged",
    "puppet_version": "3.7.4",
    "@timestamp": "2015-07-02T19:23:50.000Z",
    "metrics": {
        "changes": {
            "total": 0
        },
        "time": {
            "host": 0.001477247,
            "yumrepo": 0.014270488,
            "package": 2.03667594,
            "cron": 0.001084018,
            "datacat_fragment": 0.010101403,
            "filebucket": 0.000317264,
            "ssh_authorized_key": 0.001278677,
            "mailalias": 0.000170429,
            "resources": 0.000327163,
            "file": 1.994042057,
            "concat_build": 0.00462418,
            "archive": 0.001027334,
            "user": 0.003336606,
            "total": 16.63869804,
            "exec": 0.472291369,
            "config_retrieval": 9.700802881,
            "concat_fragment": 0.001244236,
            "service": 0.599483248,
            "group": 0.002227579,
            "datacat_collector": 0.006951844,
            "augeas": 1.783607975,
            "anchor": 0.003356102
        },
        "events": {
            "failure": 0,
            "noop": 10,
            "success": 0,
            "total": 10
        },
        "resources": {
            "restarted": 0,
            "out_of_sync": 10,
            "changed": 0,
            "failed_to_restart": 0,
            "total": 244,
            "skipped": 0,
            "scheduled": 0,
            "failed": 0
        }
    },
    "report_format": 4,
    "environment": "production",
    "tags": [
        "puppet-apply",
        "elasticsearch"
    ],
    "end_time": "2015-07-02T19:23:50Z",
    "start_time": "2015-07-02T19:23:25Z",
    "message": "Puppet run on server1.example.net unchanged",
    "@version": 1,
    "type": "puppet-report"
}

@dforste
Copy link
Contributor Author

dforste commented Jul 2, 2015

I updated it so now. all logs are put into an array with level and source.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants