83 Commits
Author SHA1 Message Date
Mustafa Akın 30e4027760 modify lasttime stamp to 5 seconds 2021-06-16 22:47:51 +03:00
Kirill Buev f50b41b9dd Do not ignore events created more than 5 seconds ago (#98)
* Filter events by LastTimestamp instead of CreationTimestamp

* Ignore events fired more than 1 minute ago
2021-06-16 22:47:24 +03:00
Mustafa Akın b1c3a9efff Merge branch 'update-slack-library' of https://github.com/jun06t/kubernetes-event-exporter into jun06t-update-slack-library 2021-06-16 22:45:02 +03:00
Mustafa Akın 5867a4eea6 Minor fixes for event bridge 2021-06-16 22:26:02 +03:00
Mustafa Akın bf1f9bdd8c resolve conflicts 2021-06-16 22:09:23 +03:00
Mustafa Akın dbcf9044fc Resolve conflicts 2021-06-16 22:06:56 +03:00
makocchi db3b1847a6 Improve slack attachment (#92)
* improve slack attachment

* update slack configuration
2021-06-16 21:36:06 +03:00
Christoph Petrausch 46c2cb70f4 elasticsearch: Add TLS client cert auth (#116)
* elasticsearch: Add TLS client cert auth

* Elasticsearch: Init RootCA certpool to prevent nil pointer dereference

* Elasticsearch: Refactor TLS setup to catch errors

Don't setup client cert auth of not both keyFile and certFile are configured
2021-06-16 21:35:06 +03:00
Jason Yanowitz ce3f5f0c78 expose InsecureSkipVerify for Kafka TLS config (#86)
Defaults to false if it's not specified.

    Co-authored-by: Joyce Yee <jzyeezy>
2021-06-16 21:34:20 +03:00
Akif Khanandakif.ak 57d362476e Syslog sink (#107)
* Implemented syslog sink, this enables pushing k8s-events to rsyslog, syslog daemon server over both tcp/udp.

* Reverting go.mod indirect dependency

* Reverting go.mod indirect dependency

Co-authored-by: akif.ak <akif.ak@flipkart.com>
2021-06-16 21:31:21 +03:00
mustafaakin-atl 6da0e1bfd3 Merge pull request #122 from freenet-group/master
Add pipe sink
2021-06-16 21:30:46 +03:00
Junpei Tsuji 1a76957af5 Use slack-go/slack instead of nlope/slack 2021-06-16 05:19:09 +09:00
Daniel Fischedick 3fffeceea1 fixed ReceiverConfig 2021-06-01 16:53:25 +02:00
Daniel Fischedick 04f8c35514 Add pipe sink 2021-05-10 14:23:29 +02:00
Christoph Petrausch 08ed16bc0f Add a DeDot function to the EnhancedObject to replace dots
This replaces all dots in the labels and annotations of the enhancedObject.

Fixes #109
2021-03-08 16:48:04 +01:00
Markus Blaschke 3b4791d54a implement stdout receiver
add stdout receiver without any rotation and additional file handling

Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
2020-10-12 20:08:20 +02:00
vikash s df79a3fbda added logs for sing 2020-10-12 15:29:07 +05:30
vikash s c1ece30710 eventbridge sink logs added 2020-10-12 13:26:59 +05:30
vikash s f0b407dc5e added eventbridge sink 2020-09-28 18:24:02 +05:30
vikash s e22b95e70e parsing event details 2020-09-17 20:09:44 +05:30
vikash s 63dc187fb6 Event bridge config added 2020-09-14 16:36:51 +05:30
Mustafa Akin f6a8e09c0d Type support added for Elasticsearch 6 and lower. Fixes #77 2020-08-22 17:38:58 +03:00
Mustafa Akın 1139c6f5c6 Merge pull request #69 from vsbus/victor/bq-try3
BigQuerySink
2020-08-22 17:21:47 +03:00
Mustafa Akın fad531f01e Merge pull request #79 from ivilimon/patch-1
Fix label matching bug
2020-08-22 15:48:20 +03:00
Mustafa Akın 2997c0ce02 Merge pull request #72 from sshishov/ss/fix_webhook_response_check
Fix comparison and use proper error message in webhook response
2020-08-22 15:45:39 +03:00
Ivana Vilimonovic 28bf293b9f add test for label regex 2020-08-14 18:31:31 -04:00
ivana f1c7400493 Fix label matching bug
Use the configured label value as the regex pattern. Currently it is trying to match the value from the config using the object's label as the pattern, which is incorrect. See also the Annotations matching below which is doing it correctly.
2020-08-14 18:07:40 -04:00
Sergei Shishov b3f99e354c Fix comparison and use proper error message 2020-07-28 13:05:39 +04:00
Jiri Brunclik 471d52de78 Fix setting alert priority in OpsGenie sink 2020-07-24 13:58:58 +02:00
Ubuntu 9f08e0d6ad big Query Sink 2020-07-21 16:44:09 -07:00
Ubuntu 519e4c2d78 mg 2020-07-09 02:03:18 +00:00
Ubuntu 5769a36640 init-draft 2020-07-09 01:29:40 +00:00
Manuel Rüger 6468760f2d pkg/sinks/receiver.go: Fix typo in filename 2020-07-02 15:09:54 +02:00
Manuel Rüger bd348fbdb4 pkg/exporter/receivers.go: Fix typo in filename 2020-07-02 15:08:39 +02:00
Mustafa Akin 077bb6654c Namespace support to work without cluster scope, fixes #42 2020-06-22 18:28:11 +03:00
Mustafa Akin fee89514e8 better default config to log to stdout, debug log added for involved object capturing 2020-06-22 18:17:18 +03:00
Mustafa Akin d262b1f7c7 Treat all 2xx succesful in webhook, fixes #57 2020-06-22 17:36:56 +03:00
Mustafa Akin c4a5dd0857 Merge branch 'master' of github.com:opsgenie/kubernetes-event-exporter into multiple-fixes-for-issues 2020-06-22 17:35:36 +03:00
Mustafa Akin 1a24caeeeb Log format support, fixes #52 2020-06-22 17:31:01 +03:00
Mustafa Akin 1ff1f121db Test for issue #51 2020-06-22 17:04:25 +03:00
Mustafa Akin 823662b2a9 Fixes #48, Elasticsearch is not taking layout although documented to do so 2020-06-22 16:55:17 +03:00
Mustafa Akın ae8bfb579d Merge pull request #53 from jaydp17/webhook-return-err
return err in webhook sink
2020-06-22 16:44:54 +03:00
Mustafa Akın 112e224047 Merge pull request #49 from lesh366/master
New ms teams support
2020-06-22 16:44:32 +03:00
Mustafa Akın 9d8c746d1b Merge pull request #45 from youyongsong/patch/support-rotate-in-file-sink
Add file rolling function in file sink.
2020-06-22 16:44:01 +03:00
Jaydeep Solanki 18bdae4d23 return err in webhook sink 2020-06-01 16:40:09 +05:30
Njegos RailicandHeinz N. Gies 80f904e39f Update pkg/sinks/webhook.go
Co-authored-by: Heinz N. Gies <heinz@licenser.net>
2020-05-29 13:09:43 +02:00
Njegos Railic 8aae6e0d9a Handle HTTP Status code 201 in the webhook sink 2020-05-29 12:32:21 +02:00
lesh366 62b1c4cae2 format alligment 2020-05-27 12:18:09 +03:00
elads bbdecb204e new microsoft teams support 2020-05-27 05:15:33 -04:00
youyongsong 15f2feb28f Add file rolling function in file sink.
I known File Sink is currently mostly used in local development, but we also tend to use it in our production environment with fluentd, because this combination is very stable and reliable.

Currently File Sink lacks the file rolling function, which is very important for the production environment. So I want to add file rolling function to File Sink through this pr without breaking changes.

file rolling is disabled by default, and can be enabled by adding the following arguments:

```yaml
- receivers:
  file:
    path: ./test.log
    maxsize: 20    // if ./test.log is larger than 20MB, it will be renamed to ./test-<datetime>.log as a backup file,
    and create a new file named test.log to receive events. It defaults to 100 megabytes.
    maxage: 20     // if backup files ./test-<datetime>.log are created 20 days ago, they will be deleted. The default
    is not to remove old log files based on age.
    maxbackups: 3  // if backup files are more than 3, older backup files will be removed.
```

the rolling function is powered by [lumberjack](https://github.com/natefinch/lumberjack). Becasue `lumberjack.Logger` implmented `io.WriteCloser` interface, so it is easy to replace `file *os.file` with `writer &lumberjack.Logger`.

run kubernetes-event-exporter with following config:
```yaml
logLevel: debug
route:
  match:
    - receiver: "file"
receivers:
  - name: "file"
    file:
      path: "./event.log"
      maxsize: 1
      maxbackups: 4
```
run following script to generate events and output `./event*.log` status:
```shell
while true
do
  kubectl run nginx --image nginx || kubectl delete deployment nginx
  ls -lh event*.log
  sleep 2
done
```
the result is:
```
deployment.apps "nginx" deleted
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:03 event-2020-03-04T10-03-30.271.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff  1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1023K Mar  4 18:54 event.log
deployment.apps/nginx created
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:15 event-2020-03-04T10-15-52.496.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:28 event-2020-03-04T10-28-27.334.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:41 event-2020-03-04T10-41-11.316.log
-rw-r--r-- 1 ysyou staff 1.0M Mar  4 18:54 event-2020-03-04T10-54-11.451.log
-rw-r--r-- 1 ysyou staff 2.0K Mar  4 18:54 event.log
```
when `event.log` reaches 1M, it is renamed to `event-2020-03-04T10-54-11.451.log`, because backup files are more than 4, the oldest one `event-2020-03-04T10-03-30.271.log` is deleted.
2020-05-06 16:07:36 +08:00