Beispiel #1
0
        public override object GetValue(IDictionary <string, object> evt)
        {
            var dict  = (IDictionary <string, object>)evt;
            var value = Arguments[0].GetValue(evt);

            return(RxKqlCommonFunctions.ReverseString(value.ToString()));
        }
Beispiel #2
0
        public override object GetValue(IDictionary <string, object> evt)
        {
            var originalValue = Arguments[1].GetValue(evt);
            var regex         = Arguments[0].GetValue(evt);

            // If the string starts or ends with a matching string of the RegEx pattern, remove it.
            return(RxKqlCommonFunctions.TrimStartWithRegex(regex.ToString(), RxKqlCommonFunctions.TrimEndWithRegex(regex.ToString(), originalValue.ToString())));
        }
        public override object GetValue(IDictionary <string, object> evt)
        {
            var argValue = Arguments[0].GetValue(evt);

            if (!RxKqlCommonFunctions.TryConvert <long>(argValue, out var longIp))
            {
                return(string.Empty);
            }
            return(RxKqlCommonFunctions.LongToIpAddress(longIp));
        }
Beispiel #4
0
        public override object GetValue(IDictionary <string, object> evt)
        {
            var value = Arguments[0].GetValue(evt);

            if (!RxKqlCommonFunctions.TryConvert <bool>(value, out var result))
            {
                throw new EvaluationTypeMismatchException($"Cannot convert value {value} to bool");
            }
            return(!result);
        }
Beispiel #5
0
        public override object GetValue(IDictionary <string, object> evt)
        {
            long result = 0;

            var dict = (IDictionary <string, object>)evt;

            string datepartName   = Arguments[0].GetValue(evt).ToString();
            var    targetDateTime = (DateTime)Arguments[1].GetValue(evt);

            result = RxKqlCommonFunctions.GetDatePart(datepartName, targetDateTime);

            return(result);
        }
        public override object GetValue(IDictionary <string, object> evt)
        {
            var arg = Arguments[0].GetValue(evt).ToString();

            return(RxKqlCommonFunctions.IpAddressToLong(arg));
        }