bkelley  
                (Butch)
               
                 
              
                  
                    May 10, 2018,  7:56pm
                   
                   
              1 
               
             
            
              Hello -
I would like to create a scripted field that takes my existing timestamp field and subtracts 1 hour.
What I have is:
timestamp_OMi 
Language: painless 
Type: date 
Format: Date 
Script: doc['@timestamp '].value - 3600000
When this is in place I receive a "Courier Fetch... shards failed" error.
Thanks for your help, 
Butch
             
            
               
               
               
            
            
           
          
            
            
              You need to use .getMillis() to get the date in milliseconds:
doc['@timestamp'].value.getMillis() - 3600000
             
            
               
               
               
            
            
           
          
            
              
                bkelley  
                (Butch)
               
              
                  
                    May 10, 2018,  8:22pm
                   
                   
              3 
               
             
            
              That was it!  Thank you for your response!
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    June 7, 2018,  8:33pm
                   
                   
              4 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.