Hi, 
I am running a test environment with following: 
ES & Kibana:5.2.2
I imported 2 .csv files from different paths using logstash input
 
I have created one index "meters" for both csv files.
 
These contain metering statistics
 
I have a field named "path"- which gives me the name of csv file such as:
 
path: "drive:/some/path/data_as_on_2017-03-15"
 
path: "drive:/some/path/data_as_on_2017-03-16"
 
Another field named "meter_read"(number) provides me the reading of meters for all metering station for specific dates.
 
Now i need to plot a line or bar chart for the meter_read difference calculated from different .csv which will be like consumption on 2017-03-15
 
consumption on 2017-03-16
 
And the difference between the meter_read value for these 2 dates.
 
 
             
            
               
               
               
            
            
           
          
            
              
                dadoonet  
                (David Pilato)
               
              
                  
                    March 23, 2017,  6:02am
                   
                   
              2 
               
             
            
              I'd try with Timelion to plot the 2 lines, shift one line with a 1 day offset then ask Timelion to do a difference.
             
            
               
               
               
            
            
           
          
            
            
              How does it work in case i have static data with no time stamp
             
            
               
               
               
            
            
           
          
            
              
                dadoonet  
                (David Pilato)
               
              
                  
                    March 23, 2017, 10:42am
                   
                   
              4 
               
             
            
              You can't then. But I thought you were mentioning time based data as you wanted to compare by 2 dates.
             
            
               
               
               
            
            
           
          
            
            
              Ok, then is there anyway i can add a new field which stores the difference such as 
meter_read_csv1 - meter_read_csv2 
which may be plotted on the graph showing the consumption.
             
            
               
               
               
            
            
           
          
            
              
                dadoonet  
                (David Pilato)
               
              
                  
                    March 26, 2017,  7:10am
                   
                   
              6 
               
             
            
              Within the same document?
Yes you can compute that on client side or use a script on elasticsearch side (update API or ingest API).
             
            
               
               
               
            
            
           
          
            
            
              Thanks David, 
I am new to ES and scripted fields, so are there any pointers or example I 
may refer with the same query.
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    April 23, 2017, 10:24am
                   
                   
              9 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.