mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	Explore/Loki: Escape \ in labels for show context queries (#26116)
* Hot fix, keep the file * Add comment * Update public/app/plugins/datasource/loki/datasource.ts Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> * Remove script.go file Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
		@@ -409,7 +409,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
 | 
			
		||||
 | 
			
		||||
  prepareLogRowContextQueryTarget = (row: LogRowModel, limit: number, direction: 'BACKWARD' | 'FORWARD') => {
 | 
			
		||||
    const query = Object.keys(row.labels)
 | 
			
		||||
      .map(label => `${label}="${row.labels[label]}"`)
 | 
			
		||||
      .map(label => `${label}="${row.labels[label].replace(/\\/g, '\\\\')}"`) // escape backslashes in label as users can't escape them by themselves
 | 
			
		||||
      .join(',');
 | 
			
		||||
 | 
			
		||||
    const contextTimeBuffer = 2 * 60 * 60 * 1000; // 2h buffer
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user