I'm working on a backend where we're using CRON expressions to find future occurrences. Now they want to replace CRON with RRULE for more flexible expressions. The problem is, we've got hundreds of CRON expressions that now need to be converted into RRULE expressions.
I can't seem to find any information about this online. All I can find is about converting RRULE into CRON expressions...
Anyone got any advice?
Related
Inside Logic App:
In my set variable of type string, I am trying to use the following expression. What is the problem here? I get the following error message. The same expression works perfectly for setting the filename in my create blob action.
formatDateTime(convertTimeZone(utcNow(),'UTC','GMT Standard Time'),'yyyy-MM-dd')
After reproducing from my end, I could see that the mentioned expression was working fine. Instead of using formatDateTime and convertTimeZone separately, According to convertTimeZone syntax you can directly use the required format within convertTimeZone itself. Below is the complete expression that will work.
convertTimeZone(utcNow(),'UTC','GMT Standard Time','yyyy-MM-dd')
According to the Official Microsoft documentation, the GMT Standard Time and UTC are in the same timezone and doesn't have any time difference. If that's the case you can use only formatDateTime and format the date time in required format.
formatDateTime(utcNow(),'yyyy-MM-dd')
Result :
I was reading one of the article from Camel Website. http://camel.apache.org/quartz.html
and i am wondering why camel need + sign in cron expression? Previously also i have used cron expression but i don't remember using + signs.
from("quartz://myGroup/myTimerName?cron=0+0/5+12-18+?+*+MON-FRI").to("activemq:Totally.Rocks");
i am facing an issue in parsing the below pattern
the log file will have log importance in the form of == or <= or >= or << or >>
I am trying the below custom pattern. Some of the log msgs may not have this pattern, so I am using *
(?(=<>)*)
But the log mesages are not parsing and give 'grokparsefailure'
kindly check and suggest if the above pattern is wrong.. Thanks much
below pattern is working fine.
(?[=<>]*)
the one which I used earlier and was erroring is
(?(=<>)*)
One thing to note, there is a better way to handle the "some do, some don't" aspect of your log-data.
(?<Importance>(=<>)*)
That will match more than you want. To get the sense of 'sometimes':
((?<Importance>(=<>)*)|^)
This says, match these three characters and define the field Importance, or leave the field unset.
Second, you're matching specifically two characters, in combinations:
((?<Importance>(<|>|=){2})|^)
This should match two instances of any of the trio of characters you're looking for.
I have a requirement where I need the pattern ICU uses to format the given date/time.
For example: If I have something like DateFormat.getDateInstance(DateFormat.SHORT, en_US).format(currentDate) gives me 5/3/2015, then I need an API which can tell me that the pattern ICU4J internally using is d/M/yyyy.
I did figure out a solution, all you need to do is convert the DateFormat into a SimpleDateFormat and call toPattern().
((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.SHORT, en_US)).toPattern() returns d/M/y which is what I almost needed.
I am trying to generate a drop-down for a Jenkins job that will parse out the version numbers from the file names in a Linux directory. I have gotten it to work most of the way but I think my lack of knowledge of groovy has me at a standstill. Here is the code I have:
Arrays.asList(new File("/path/to/files").list().join(", ").findAll(/(\d+)\.(\d+)\.(\d+)\.(\d+)/))
and my file names look like:
returns?-?1.0.0.19?.war
returns?-?1.0.0.20?.war
What I get as a return from the Jenkins script console is:
Result: [[1.0.0.19, 1.0.0.20]]
This is essentially what I want but in the Jenkins job I get one item in the drop-down that is everything inside the outer brackets.
[1.0.0.19, 1.0.0.20]
I think the second set of brackets is the issue and I have tried to remove them using Groovy's .minus() method, double escaping the brackets, with no luck. I have also tried the .split() method, with no luck.
Any help would be greatly appreciated!
You do not need Arrays.asList(). Below should suffice.
new File("/opt/staples/ci-tools/workspace/archive/returns")
.list()
.join(',')
.findAll(/(\d+)\.(\d+)\.(\d+)\.(\d+)/)