Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to convert date to epoch time in HCP Grok parser

Solved Go to solution
Highlighted

How to convert date to epoch time in HCP Grok parser

Contributor

Hi all,

I'm trying to add new telemetry of http-access log which have date format to HCP, but for the sensor to work i need to specify the timestampField on the sensor's JSON RAW which only recognize epoch format.

How can i convert the date format of log ( ex. 20/May/2017:12:19:39 +0700) to epoch format with grok parsher?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to convert date to epoch time in HCP Grok parser

Contributor

Problem solved, i follow this link, and add this to the JSON Raw after "patternLabel":

"timestampField": "timestamp",
		"timeFields": ["timestamp"],
		"dateFormat": "dd/MMM/yyyy:HH:mm:ss Z"
1 REPLY 1

Re: How to convert date to epoch time in HCP Grok parser

Contributor

Problem solved, i follow this link, and add this to the JSON Raw after "patternLabel":

"timestampField": "timestamp",
		"timeFields": ["timestamp"],
		"dateFormat": "dd/MMM/yyyy:HH:mm:ss Z"
Don't have an account?
Coming from Hortonworks? Activate your account here