support json, jsonnet, yaml formats
- jsonnet, json and yaml support for configuration - json and yaml support for output formats fix #40 fix #27
This commit is contained in:
		
							
								
								
									
										30
									
								
								config/reaction.test.jsonnet
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								config/reaction.test.jsonnet
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,30 @@
 | 
			
		||||
{
 | 
			
		||||
  patterns: {
 | 
			
		||||
    num: {
 | 
			
		||||
      regex: '[0-9]+',
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  streams: {
 | 
			
		||||
    tailDown1: {
 | 
			
		||||
      cmd: ['sh', '-c', "echo 1 2 3 4 5 1 2 3 4 5 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 | tr ' ' '\n' | while read i; do sleep 2; echo found $(($i % 10)); done"],
 | 
			
		||||
      filters: {
 | 
			
		||||
        findIP: {
 | 
			
		||||
          regex: ['^found <num>$'],
 | 
			
		||||
          retry: 3,
 | 
			
		||||
          retryperiod: '30s',
 | 
			
		||||
          actions: {
 | 
			
		||||
            damn: {
 | 
			
		||||
              cmd: ['echo', '<num>'],
 | 
			
		||||
            },
 | 
			
		||||
            undamn: {
 | 
			
		||||
              cmd: ['echo', 'undamn', '<num>'],
 | 
			
		||||
              after: '30s',
 | 
			
		||||
              onexit: true,
 | 
			
		||||
            },
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user