What's this number in celery stdout output after datetime timestamp - celery

It's important that I parse it and save as some important piece of information.
But I don't know what it is. Can someone please tell me what it is?
[2015-04-09 12:45:07,807: WARNING/Worker-3] Some log message, started some task.
[2015-04-09 12:45:07,812: INFO/MainProcess] Task blaah succeeded in 5.35s: None
The numbers 807, and 812. What are they?

The numbers you refer to are the milliseconds in the timestamp.
Celery's default log format is:
[%(asctime)s: %(levelname)s/%(processName)s] [%(task_name)s(%(task_id)s)] %(message)s

Related

DATEDIF statement in SharePoint not working properly

I am trying to calculate the amount of days between two dates but my formula doesn't seem to be working properly. It's as is the function is ignoring the years in the dates. My function is as follows:
=IF([Today's date]>[Expiration Date],-DATEDIF([Expiration Date],[Today's date],"d"),(DATEDIF([Today's date],[Expiration Date],"d")))
I receive this error if I use the above function(Owners removed):
But then I replace -DATEDIF([Expiration Date],[Today's date],"d") with -DATEDIF([Today's date],[Expiration Date]"d") i get this result:
This is telling me that both cases are being treated as IF([Today's date]>[Expiration Date] even though 3/24/2015 is clearly larger than 11/03/2014. Can somebody please tell me what I'm doing wrong? Thanks.
=[ExpirationDate] - [TodaysDate]

Robotframework: Getting date at runtime using Get Current Date, in specific format

I am using the Get Current Date keyword to return the date in the format year-month-day. I use this particular information to make sure that an account's created timestamp is correct in automated tests.
The issue is that the keyword is not recognised, my code should be correct (it should work and it should produce the date in the format I wish.
*** Keywords ***
Initialize Test Data
${DATE}= Get Current Date result_format=timestamp
${MYNUM}= faker.Random Int
Set Suite Variable ${MYNUM}
Set Suite Variable ${DATE}
Why do I get the error No keyword with name 'Get Current Date' found.?
Thanks in advance.
Does a keyword Get Current Date exist in standard RF lib? There is a builtin keyword called Get Time instead. Documentation explains how to format output. To use Get Current Date you need to import DateTime library first.
Update:
RF script sample which works for me:
*** Settings ***
Library DateTime
*** Test Cases ***
datatimetest
${d}= get time
log {d}
${d}= Get Current Date result_format=%Y-%m-%d
log {d}
${d} = Add Time To Date 2014-05-28 12:05:03.111 7 days
log {d}
Please remember that DateTime is a new library so in case you have old version of Robot Framework, you need to either install library or upgrade RF.
I'm using RF with Python and by default my IDE detects Python DateTime library.
Try to use the full path:
Library robot.libraries.DateTime
robot.libraries.DateTime.
You can also format the time as you like. See this answer. It offers format suggestions. You can use Python DateTime functions as in
${now} Evaluate '{dt.day}/{dt.month}/{dt.year}'.format(dt=datetime.datetime.now()) modules=datetime
Log ${now}
Log to Console now time 1: ${now}
${now} Evaluate '{dt:%A}, {dt:%B} {dt.day}, {dt.year}'.format(dt=datetime.datetime.now()) modules=datetime
Log ${now}
Log to Console now time 2: ${now}

How to set date with time in sxw using python for openerp report?

I am generation report in openerp. that ways is, I created sxw and convet into rml then rml into pdf. It is working fine now. What my doubts is, when try to get date and time field value, it's getting only date. Time is not coming in pdf report.
Field name in python: 'sample_receipt_date':datetime(....)
in sxw: [[formatLang(o.sample_receipt_date,date=True)]]
After convert pdf: dd/mm/yy
but i want this format dd/mm/yy/min/sec in pdf.
what is python coding in sxw document?
[[ time.ctime() ]] should work in RML, otherwise, take a look at https://doc.openerp.com/6.1/vi/developer/05_reports/ or the full RML for Idiots manual
Try this:
replace (date=True) By (date_time=True)

Odd Logstash date parsing error

I'm getting the following error from Logstash:
{:timestamp=>"2013-12-30T17:05:01.968000-0800", :message=>"Failed parsing date from field", :field=>"message", :value=>"2013-12-30 17:04:59,539.539 INFO 14282:140418951137024 [foo.lib.base.onResults:152] -- /1.12/media - \"getMediaStoreUrl\": , 10.101.AA.BB, 10.101.19.254 took 0.170675992966, returning https://foo.s3.amazonaws.com/foo/customerMedia/1009238911/23883995/image?Signature=%2BfXqEdNWtWdhwzi%&*YEGJSDDdDFF%3D&Expires=1388455499&AWSAccessKeyId=NOIMNOTTHATSTUPID>, , >>>", :exception=>java.lang.IllegalArgumentException: Invalid format: "2013-12-30 17:04:59,539.539 INFO 14282:140418951137024..." is malformed at ".539 INFO 14282:140418951137024...", :level=>:warn}
The error is obviously about the date format, which comes to me as:
2013-12-30 17:04:59,539.539 INFO 14282:140418951137024...
And my pattern is as follows:
date {
match => ["message", "yyyy-MM-dd HH:mm:ss,SSS"]
}
I read up on the Joda-Time Library and I think I've got the format correct above. It's odd to me that the error message contains the doubled SSS (milliseconds) portion: ",539.539" (our logs output that way for some reason). I deliberately didn't put the second portion ".539" in my pattern because I want it ignored.
I am also successfully using the following pattern in another filter:
(?<pylonsdate>%{DATESTAMP}\.[0-9]+)
I'm just not exactly sure where this error is coming from. Any ideas what I need to do to correct this? Do I need to mutate #timestamp? Any help is appreciated!
The error is because the other information in "message" field will make date api parsing error.
Ex: INFO 14282:140418951137024...
You can use grok api to get the date and then use date api/
grok {
match => ["message","%{DATESTAMP:logtime}\.[0-9]+"]
}
date {
match => ["logtime","YY-MM-dd HH:mm:ss,SSS"]
}
I have tried this configuration with your log. It works on me. Hope this can help you .
FWIW, it may be due to this bug in the Logstash date filter.
I have a much simpler date filter that generates the same error, and came across your question while searching for the answer.

MongoDB create date get month issue?

Can someone please shed some light on why when I create a date object I receive the wrong month like so:
new Date("2013-11-25").getMonth()
output> 10
new Date("2013-11-25").toISOString()
output> 2013-11-25T00:00:00.000Z
I've seen this happen a couple of times and it's confusing me slightly. Is it a bug or am I missing something?
It is correct. This happens because in javascript month start from 0 not 1.
You can read in details here.