Skip to content

add support for multiple arns #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: feature/api_gateway_logging_temp_cred
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"context"
"log"
"os"
"os/signal"
"strings"
"syscall"

"github.com/akto-api-security/api-gateway-logging/logprocesser"
"github.com/akto-api-security/api-gateway-logging/trafficUtil/kafkaUtil"
Expand Down Expand Up @@ -61,10 +64,22 @@ func main() {

kafkaUtil.InitKafka()

utils.DebugLog("Starting log processer for log group: %s", logGroupArn)
logGroupArns := strings.Split(logGroupArn, ",")

// Start monitoring the log group
if err := logprocesser.MonitorLogGroup(context.TODO(), client, logGroupArn); err != nil {
log.Fatalf("Error monitoring log group: %v", err)
for _, logGroupArnTemp := range logGroupArns {
// Start monitoring the log group
logGroupArnTemp = strings.Trim(logGroupArnTemp, " ")
go func() {
utils.DebugLog("Starting log processor for log group: %s", logGroupArnTemp)
if err := logprocesser.MonitorLogGroup(context.TODO(), client, logGroupArnTemp); err != nil {
log.Fatalf("Error monitoring log group: %v", err)
}
}()
}

sig := make(chan os.Signal, 1)
signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
<-sig
log.Println("Signaled to terminate")

}
Loading