... | rex field=yourfield "(?<year>.+?)-(?<month>.+?)-(?<day>.+)"
Substitute yourfield
with whatever your field is called.
... | rex field=yourfield "(?<year>.+?)-(?<month>.+?)-(?<day>.+)"
Substitute yourfield
with whatever your field is called.
Excellent. Could you please mark my answer as accepted? Thanks!
Thanks this works for me now...
With all due respect: http://lmgtfy.com/?q=strftime
I am not able to find out the complete doc for strftime, can you make this search ?
Yes, using the same technique. Look up all strftime parameters, there are many different ones.
cool it works , also is there any way to find month name also (jan ,feb etc) form search?
Correcting myself - apparently strftime
can handle this, using the %u (week starting on Monday) or %U (week starting on Sunday) parameter!
You could do something like this to get the week number:
eval week=strftime(strptime(yourfield,"%Y-%m-%d"),"%U")
I mean to say that I want week number from this search so that I can make chart wrt week number
Not easily done, as that will change from year to year. Your best bet would probably be to create a lookup file that maps dates to week numbers and use that.
yes, its week number
What do you mean by week, week number?
ok it works for month , but how I can figure out about the week