mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
add Hostname helper in expr and templating (#2193)
This commit is contained in:
parent
71b7a594bd
commit
4ae41a363d
3 changed files with 17 additions and 0 deletions
|
@ -595,3 +595,11 @@ func B64Decode(params ...any) (any, error) {
|
|||
}
|
||||
return string(decoded), nil
|
||||
}
|
||||
|
||||
func Hostname(params ...any) (any, error) {
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return hostname, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue