Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "delete-aws-es-incidents", Short: "Delete ELK incidents on AWS ES 5.1", Long: "", Run: func(cmd *cobra.Command, args []string) { if esURL == "" { println("No Elasticsearch URL present, can't continue.") os.Exit(0) } client, err := elastic.NewClient( elastic.SetURL(esURL), elastic.SetSniff(false), ) if err != nil { panic(err) } esversion, err := client.ElasticsearchVersion(esURL) if err != nil { panic(err) } fmt.Printf("Elasticsearch version %s\n", esversion) runCommand() var wgm sync.WaitGroup cron := cron.New() cron.AddFunc("@hourly", func() { runCommand() }) cron.Start() println("Cron run started...") wgm.Add(1) wgm.Wait() }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.