Documentation ¶
Index ¶
- Variables
- func Atof(x string) float64
- func CrowdsecCTI(ip string) (*cticlient.SmokeItem, error)
- func CrowdsecCTIInitCache(size int, ttl time.Duration)
- func Distance(lat1 string, long1 string, lat2 string, long2 string) (float64, error)
- func File(filename string) []string
- func FileInit(fileFolder string, filename string, fileType string) error
- func Get(arr []string, index int) string
- func GetDecisionsCount(value string) int
- func GetDecisionsSinceCount(value string, since string) int
- func GetExprEnv(ctx map[string]interface{}) map[string]interface{}
- func Init(databaseClient *database.Client) error
- func InitCrowdsecCTI(Key *string, TTL *time.Duration, Size *int, LogLevel *log.Level) error
- func IpInRange(ip string, ipRange string) bool
- func IpToRange(ip string, cidr string) string
- func IsIP(ip string) bool
- func IsIPV4(ip string) bool
- func IsIPV6(ip string) bool
- func JsonExtract(jsblob string, target string) string
- func JsonExtractLib(jsblob string, target ...string) string
- func JsonExtractObject(jsblob string, target string) map[string]interface{}
- func JsonExtractSlice(jsblob string, target string) []interface{}
- func JsonExtractUnescape(jsblob string, target ...string) string
- func KeyExists(key string, dict map[string]interface{}) bool
- func LookupHost(value string) []string
- func Lower(s string) string
- func Match(pattern, name string) bool
- func ParseUnix(value string) string
- func ParseUnixTime(value string) (time.Time, error)
- func ParseUri(uri string) map[string][]string
- func PathEscape(s string) string
- func PathUnescape(s string) string
- func QueryEscape(s string) string
- func QueryUnescape(s string) string
- func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
- func RegexpInFile(data string, filename string) bool
- func ShutdownCrowdsecCTI()
- func TimeNow() string
- func ToJson(obj interface{}) string
- func ToString(value interface{}) string
- func UpdateRegexpCacheMetrics()
- func Upper(s string) string
- func XMLGetAttributeValue(xmlString string, path string, attributeName string) string
- func XMLGetNodeValue(xmlString string, path string) string
- type ExprDebugger
Constants ¶
This section is empty.
Variables ¶
View Source
var CTIApiEnabled = true
this is set for non-recoverable errors, such as 403 when querying API or empty API key
View Source
var CTIApiKey = ""
View Source
var CTIBackOffDuration time.Duration = 5 * time.Minute
View Source
var CTIBackOffUntil time.Time
when hitting quotas or auth errors, we temporarily disable the API
View Source
var CTICache gcache.Cache
Cache for responses
View Source
var CTIUrl = "https://cti.api.crowdsec.net"
View Source
var CTIUrlSuffix = "/v2/smoke/"
View Source
var CacheExpiration time.Duration
View Source
var RegexpCacheMetrics = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "cs_regexp_cache_size", Help: "Entries per regexp cache.", }, []string{"name"}, )
prometheus
Functions ¶
func CrowdsecCTIInitCache ¶ added in v1.5.0
func GetDecisionsCount ¶ added in v1.4.0
func GetDecisionsSinceCount ¶ added in v1.4.0
func GetExprEnv ¶
func InitCrowdsecCTI ¶ added in v1.5.0
func JsonExtract ¶ added in v0.0.3
func JsonExtractLib ¶ added in v0.0.3
func JsonExtractObject ¶ added in v1.4.0
func JsonExtractSlice ¶ added in v1.4.0
func JsonExtractUnescape ¶ added in v1.2.0
func LookupHost ¶ added in v1.4.2
func PathEscape ¶ added in v1.2.2
func PathUnescape ¶ added in v1.2.2
func QueryEscape ¶ added in v1.2.2
func QueryUnescape ¶ added in v1.2.2
func RegexpCacheInit ¶ added in v1.5.0
func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
func RegexpInFile ¶ added in v0.1.0
func ShutdownCrowdsecCTI ¶ added in v1.5.0
func ShutdownCrowdsecCTI()
func UpdateRegexpCacheMetrics ¶ added in v1.5.0
func UpdateRegexpCacheMetrics()
UpdateCacheMetrics is called directly by the prom handler
func XMLGetAttributeValue ¶ added in v1.4.0
func XMLGetNodeValue ¶ added in v1.4.0
Types ¶
type ExprDebugger ¶ added in v0.3.1
type ExprDebugger struct {
// contains filtered or unexported fields
}
ExprDebugger contains the list of expression to be run when debugging an expression filter
func NewDebugger ¶ added in v0.3.1
func NewDebugger(filter string, exprEnv expr.Option) (*ExprDebugger, error)
NewDebugger is the exported function that build the debuggers expressions
Click to show internal directories.
Click to hide internal directories.