Documentation ¶
Index ¶
- Variables
- func Atof(params ...any) (any, error)
- func B64Decode(params ...any) (any, error)
- func CrowdsecCTI(params ...any) (any, error)
- func CrowdsecCTIInitCache(size int, ttl time.Duration)
- func Distance(params ...any) (any, error)
- func Fields(params ...any) (any, error)
- func File(params ...any) (any, error)
- func FileInit(fileFolder string, filename string, fileType string) error
- func FloatApproxEqual(params ...any) (any, error)
- func Get(params ...any) (any, error)
- func GetDecisionsCount(params ...any) (any, error)
- func GetDecisionsSinceCount(params ...any) (any, error)
- func GetExprOptions(ctx map[string]interface{}) []expr.Option
- func GetFromStash(params ...any) (any, error)
- func Hostname(params ...any) (any, error)
- func Index(params ...any) (any, error)
- func IndexAny(params ...any) (any, error)
- func Init(databaseClient *database.Client) error
- func InitCrowdsecCTI(Key *string, TTL *time.Duration, Size *int, LogLevel *log.Level) error
- func IpInRange(params ...any) (any, error)
- func IpToRange(params ...any) (any, error)
- func IsIP(params ...any) (any, error)
- func IsIPV4(params ...any) (any, error)
- func IsIPV6(params ...any) (any, error)
- func Join(params ...any) (any, error)
- func JsonExtract(params ...any) (any, error)
- func JsonExtractLib(params ...any) (any, error)
- func JsonExtractObject(params ...any) (any, error)
- func JsonExtractSlice(params ...any) (any, error)
- func JsonExtractUnescape(params ...any) (any, error)
- func KeyExists(params ...any) (any, error)
- func LogInfo(params ...any) (any, error)
- func LookupHost(params ...any) (any, error)
- func Lower(params ...any) (any, error)
- func Match(params ...any) (any, error)
- func ParseKV(params ...any) (any, error)
- func ParseUnix(params ...any) (any, error)
- func ParseUnixTime(params ...any) (any, error)
- func ParseUri(params ...any) (any, error)
- func PathEscape(params ...any) (any, error)
- func PathUnescape(params ...any) (any, error)
- func QueryEscape(params ...any) (any, error)
- func QueryUnescape(params ...any) (any, error)
- func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
- func RegexpInFile(params ...any) (any, error)
- func Replace(params ...any) (any, error)
- func ReplaceAll(params ...any) (any, error)
- func SetInStash(params ...any) (any, error)
- func ShutdownCrowdsecCTI()
- func Split(params ...any) (any, error)
- func SplitAfter(params ...any) (any, error)
- func SplitAfterN(params ...any) (any, error)
- func SplitN(params ...any) (any, error)
- func Sprintf(params ...any) (any, error)
- func TimeNow(params ...any) (any, error)
- func ToJson(params ...any) (any, error)
- func ToString(params ...any) (any, error)
- func Trim(params ...any) (any, error)
- func TrimLeft(params ...any) (any, error)
- func TrimPrefix(params ...any) (any, error)
- func TrimRight(params ...any) (any, error)
- func TrimSpace(params ...any) (any, error)
- func TrimSuffix(params ...any) (any, error)
- func UnmarshalJSON(params ...any) (any, error)
- func UpdateRegexpCacheMetrics()
- func Upper(params ...any) (any, error)
- func XMLGetAttributeValue(params ...any) (any, error)
- func XMLGetNodeValue(params ...any) (any, error)
- type ExprDebugger
Constants ¶
This section is empty.
Variables ¶
var CTIApiEnabled = false
this is set for non-recoverable errors, such as 403 when querying API or empty API key
var CTIApiKey = ""
var CTIBackOffDuration time.Duration = 5 * time.Minute
var CTIBackOffUntil time.Time
when hitting quotas or auth errors, we temporarily disable the API
var CTICache gcache.Cache
Cache for responses
var CTIUrl = "https://cti.api.crowdsec.net"
var CTIUrlSuffix = "/v2/smoke/"
var CacheExpiration time.Duration
var RegexpCacheMetrics = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Name: "cs_regexp_cache_size", Help: "Entries per regexp cache.", }, []string{"name"}, )
prometheus
Functions ¶
func CrowdsecCTI ¶ added in v1.5.0
func CrowdsecCTI(ip string) (*cticlient.SmokeItem, error) {
func CrowdsecCTIInitCache ¶ added in v1.5.0
func Distance ¶ added in v1.5.0
func Distance(lat1 string, long1 string, lat2 string, long2 string) (float64, error) {
func FloatApproxEqual ¶ added in v1.5.5
func GetDecisionsCount ¶ added in v1.4.0
func GetDecisionsCount(value string) int {
func GetDecisionsSinceCount ¶ added in v1.4.0
func GetDecisionsSinceCount(value string, since string) int {
func GetExprOptions ¶ added in v1.5.0
func GetFromStash ¶ added in v1.5.0
func GetFromStash(cacheName string, key string) (string, error) {
func InitCrowdsecCTI ¶ added in v1.5.0
func JsonExtract ¶ added in v0.0.3
func JsonExtract(jsblob string, target string) string {
func JsonExtractLib ¶ added in v0.0.3
func JsonExtractLib(jsblob string, target ...string) string {
func JsonExtractObject ¶ added in v1.4.0
func JsonExtractObject(jsblob string, target string) map[string]interface{} {
func JsonExtractSlice ¶ added in v1.4.0
func JsonExtractSlice(jsblob string, target string) []interface{} {
func JsonExtractUnescape ¶ added in v1.2.0
func JsonExtractUnescape(jsblob string, target ...string) string {
func LookupHost ¶ added in v1.4.2
func LookupHost(value string) []string {
func ParseUnixTime ¶ added in v1.5.0
func ParseUnixTime(value string) (time.Time, error) {
func PathEscape ¶ added in v1.2.2
func PathEscape(s string) string {
func PathUnescape ¶ added in v1.2.2
func PathUnescape(s string) string {
func QueryEscape ¶ added in v1.2.2
func QueryEscape(s string) string {
func QueryUnescape ¶ added in v1.2.2
func QueryUnescape(s string) string {
func RegexpCacheInit ¶ added in v1.5.0
func RegexpCacheInit(filename string, CacheCfg types.DataSource) error
func RegexpInFile ¶ added in v0.1.0
func RegexpInFile(data string, filename string) bool {
func ReplaceAll ¶ added in v1.5.0
func SetInStash ¶ added in v1.5.0
func SetInStash(cacheName string, key string, value string, expiration *time.Duration) any {
func ShutdownCrowdsecCTI ¶ added in v1.5.0
func ShutdownCrowdsecCTI()
func SplitAfter ¶ added in v1.5.0
func SplitAfterN ¶ added in v1.5.0
func TrimPrefix ¶ added in v1.5.0
func TrimSuffix ¶ added in v1.5.0
func UnmarshalJSON ¶ added in v1.5.0
Func UnmarshalJSON(jsonBlob []byte, target interface{}) error {
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 XMLGetAttributeValue(xmlString string, path string, attributeName string) string {
func XMLGetNodeValue ¶ added in v1.4.0
func XMLGetNodeValue(xmlString string, path string) string {
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