Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Folks,
i am going to create a dash board with log files, but in the below image it was showing 5 records for Japan.
How to find the latest one, can you help some one..
@Sub2u
Hi
Try like this
LOad *, Timestamp(Timestamp#(Left(Replace(Text(Timestamp), 'T', ''),14),'YYYYMMDDHHmmSS'),'DD/MM/YYYY HH:mm:SS TT') as Time
inline [
Timestamp
20160223T150028.306-0800
];
Hi,
Please find the below image.
Regards,
SubbaReddy.
Hi
Below script also not working?
Load *, Timestamp(Timestamp#(Left(Replace(Text(Timestamp), 'T', ''),14),'YYYYMMDDHHmmSS'),'DD/MM/YYYY HH:mm:SS TT') as Time
inline [
Timestamp
20160223T150028.306-0800
];
HI,
It is working fine. whats the issue? What value you are getting and what you want.
Regards,
Kaushik Solanki
Hi Kaushik,
I want to show only last record of Japan...
@SubbaReddy.
Subbareddy, first convert the field values into new timestamp field. After that use the group by function on the key filed and Inner join on the Key and maximum time stamp.
Source:
LOAD
*,
Timestamp(Timestamp#(Replace(subfield(text(timestamp_field),'.',1),'T',' '),'YYYYMMDD hhmmss')) as new_timestamp
From source;
InnerJoin(Source)
LOAD
keyfield,
max(new_timestamp) as new_timestamp
resident Source
group by keyfield;