I want to count the number every second to get the maximum count. 
So i'm trying to group by my_date_field.
SELECT SUBSTR(CONCAT(TO_CHAR(my_date_field)),4), COUNT(*) FROM "my_index_name" GROUP BY SUBSTR(CONCAT(TO_CHAR(my_date_field)),4)
but TO_CHAR is unknown function... 
and i show like this..
  
  
    I  have  create_date  column as timestamp  in database and  need  create_date value in  elastic as "MM/DD/YYYY" 
or "yyyy-MM-dd" . I  am  getting below  error exception while  loading  data from oracle database  using logstash 2.4. 
SQL: 
select to_date(to_char(cast(create_date as date),'MM/DD/YYYY') ,'MM/DD/YYYY')  from  table X. 
exception. 
"error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse [create_date]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"In…
   
 
my_date_field format is strict_date_time(yyy-MM-dd'T'HH:mm:ss.SSSZZ).
how can i set to get max records?