mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 04:15:54 +02:00
Fix 1737 (#1738)
* add GetMeta to *types.Event Co-authored-by: sabban <15465465+sabban@users.noreply.github.com>
This commit is contained in:
parent
9d199fd4a9
commit
b2130b1593
2 changed files with 28 additions and 0 deletions
|
@ -41,6 +41,15 @@ func (e *Event) GetMeta(key string) string {
|
|||
return ""
|
||||
}
|
||||
|
||||
func (a *Alert) GetMeta(key string) string {
|
||||
for _, meta := range a.Meta {
|
||||
if meta.Key == key {
|
||||
return meta.Value
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (s Source) GetValue() string {
|
||||
if s.Value == nil {
|
||||
return ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue