Make e-r compatible with old/new logstash schemas.
* elastic_recheck/elasticRecheck.py: Update templated queries to use non '@' prefixed fields and flatten the old '@fields' field. This is possible because query for foo_field will find foo_field and @fields.foo_field. Also, handle the case where @fields may not be present in the query results. * queries.yaml: Update queries using the same rules as in elasticRecheck.py Change-Id: I48672912d05c7ad557e948cfef0402c7c89582f6
This commit is contained in:
parent
a019c9e4d0
commit
222949b717
|
@ -107,7 +107,7 @@ class Classifier():
|
|||
},
|
||||
"query": {
|
||||
"query_string": {
|
||||
"query": '%s AND @fields.build_change:"%s" AND @fields.build_patchset:"%s"'
|
||||
"query": '%s AND build_change:"%s" AND build_patchset:"%s"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,13 +117,13 @@ class Classifier():
|
|||
},
|
||||
"query": {
|
||||
"query_string": {
|
||||
"query": '@fields.build_status:"FAILURE" AND @fields.build_change:"%s" AND @fields.build_patchset:"%s"'
|
||||
"query": 'build_status:"FAILURE" AND build_change:"%s" AND build_patchset:"%s"'
|
||||
}
|
||||
},
|
||||
"facets": {
|
||||
"tag": {
|
||||
"terms": {
|
||||
"field": "@fields.filename",
|
||||
"field": "filename",
|
||||
"size": 80
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ class Classifier():
|
|||
},
|
||||
"query": {
|
||||
"query_string": {
|
||||
"query": '@tags:"console.html" AND (@message:"Finished: FAILURE") AND @fields.build_change:"%s" AND @fields.build_patchset:"%s"'
|
||||
"query": 'filename:"console.html" AND (@message:"Finished: FAILURE" OR message:"Finished: FAILURE") AND build_change:"%s" AND build_patchset:"%s"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,8 @@ class Classifier():
|
|||
|
||||
def _urls_match(self, comment, results):
|
||||
for result in results:
|
||||
url = result["_source"]['@fields']['log_url']
|
||||
fields = result['_source'].get('@fields', result['_source'])
|
||||
url = fields['log_url']
|
||||
if RequiredFiles.prep_url(url) in comment:
|
||||
return True
|
||||
return False
|
||||
|
|
83
queries.yaml
83
queries.yaml
|
@ -1,64 +1,83 @@
|
|||
- bug: 1226337
|
||||
query: >
|
||||
@message:"NovaException: iSCSI device not found at"
|
||||
AND @fields.filename:"logs/screen-n-cpu.txt"
|
||||
( @message:"NovaException: iSCSI device not found at"
|
||||
OR message:"NovaException: iSCSI device not found at" )
|
||||
AND filename:"logs/screen-n-cpu.txt"
|
||||
- bug: 1211915
|
||||
query: >
|
||||
@message:"ConnectionFailed: Connection to neutron failed: Maximum attempts reached"
|
||||
AND @fields.filename:"console.html"
|
||||
( @message:"ConnectionFailed: Connection to neutron failed: Maximum attempts reached"
|
||||
OR message:"ConnectionFailed: Connection to neutron failed: Maximum attempts reached" )
|
||||
AND filename:"console.html"
|
||||
- bug: 1217734
|
||||
query: >
|
||||
@message:"CalledProcessError: Command 'openssl' returned non-zero exit status"
|
||||
( @message:"CalledProcessError: Command 'openssl' returned non-zero exit status"
|
||||
OR message:"CalledProcessError: Command 'openssl' returned non-zero exit status" )
|
||||
- bug: 1191960
|
||||
query: >
|
||||
@message:"Exit code: 5"
|
||||
AND @message:" sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvremove -f"
|
||||
AND @fields.filename:"logs/screen-c-vol.txt"
|
||||
(( @message:"Exit code: 5"
|
||||
AND @message:" sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvremove -f" )
|
||||
OR ( message:"Exit code: 5"
|
||||
AND message:" sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvremove -f" ))
|
||||
AND filename:"logs/screen-c-vol.txt"
|
||||
- bug: 1225664
|
||||
query: >
|
||||
@message:"Details: Time Limit Exceeded! (400s)while waiting for active, but we got killed."
|
||||
AND @fields.filename:"console.html"
|
||||
( @message:"Details: Time Limit Exceeded! (400s)while waiting for active, but we got killed."
|
||||
OR message:"Details: Time Limit Exceeded! (400s)while waiting for active, but we got killed." )
|
||||
AND filename:"console.html"
|
||||
- bug: 1218391
|
||||
query: >
|
||||
@message:"Cannot 'createImage'"
|
||||
AND @fields.filename:"console.html"
|
||||
( @message:"Cannot 'createImage'"
|
||||
OR message:"Cannot 'createImage'" )
|
||||
AND filename:"console.html"
|
||||
- bug: 1229475
|
||||
query: >
|
||||
@message:"Second simultaneous read on fileno"
|
||||
( @message:"Second simultaneous read on fileno"
|
||||
OR message:"Second simultaneous read on fileno" )
|
||||
- bug: 1230407
|
||||
query: >
|
||||
@message:"Lock wait timeout exceeded; try restarting transaction"
|
||||
AND @fields.filename:"logs/screen-q-svc.txt"
|
||||
( @message:"Lock wait timeout exceeded; try restarting transaction"
|
||||
OR message:"Lock wait timeout exceeded; try restarting transaction" )
|
||||
AND filename:"logs/screen-q-svc.txt"
|
||||
- bug: 1224001
|
||||
query: >
|
||||
@message:"tempest.scenario.test_network_basic_ops AssertionError: Timed out waiting for"
|
||||
AND @fields.filename:"console.html"
|
||||
( @message:"tempest.scenario.test_network_basic_ops AssertionError: Timed out waiting for"
|
||||
OR message:"tempest.scenario.test_network_basic_ops AssertionError: Timed out waiting for" )
|
||||
AND filename:"console.html"
|
||||
- bug: 1235486
|
||||
query: >
|
||||
@message:"update or delete on table \"networks\" violates foreign key constraint"
|
||||
AND @fields.filename:"logs/screen-q-svc.txt"
|
||||
( @message:"update or delete on table \"networks\" violates foreign key constraint"
|
||||
OR message:"update or delete on table \"networks\" violates foreign key constraint" )
|
||||
AND filename:"logs/screen-q-svc.txt"
|
||||
- bug: 1232748
|
||||
query: >
|
||||
@message:"OperationalError: (OperationalError) could not translate host name \"localhost\" to address"
|
||||
AND @fields.filename:"logs/screen-n-api.txt"
|
||||
( @message:"OperationalError: (OperationalError) could not translate host name \"localhost\" to address"
|
||||
OR message:"OperationalError: (OperationalError) could not translate host name \"localhost\" to address" )
|
||||
AND filename:"logs/screen-n-api.txt"
|
||||
- bug: 1235435
|
||||
query: >
|
||||
@message:"One or more ports have an IP allocation from this subnet"
|
||||
AND @fields.filename:"logs/screen-q-svc.txt"
|
||||
AND @message:" SubnetInUse: Unable to complete operation on subnet"
|
||||
(( @message:"One or more ports have an IP allocation from this subnet"
|
||||
AND @message:" SubnetInUse: Unable to complete operation on subnet" )
|
||||
OR ( message:"One or more ports have an IP allocation from this subnet"
|
||||
AND message:" SubnetInUse: Unable to complete operation on subnet" ))
|
||||
AND filename:"logs/screen-q-svc.txt"
|
||||
- bug: 1235437
|
||||
query: >
|
||||
@message:"failed to reach ACTIVE status within the required time (400 s). Current status: BUILD"
|
||||
AND @fields.filename:"console.html"
|
||||
( @message:"failed to reach ACTIVE status within the required time (400 s). Current status: BUILD"
|
||||
OR message:"failed to reach ACTIVE status within the required time (400 s). Current status: BUILD" )
|
||||
AND filename:"console.html"
|
||||
- bug: 1239637
|
||||
query: >
|
||||
@message:"DBError: (IntegrityError) null value in column \"network_id\" violates not-null constraint"
|
||||
AND @fields.filename:"logs/screen-q-svc.txt"
|
||||
( @message:"DBError: (IntegrityError) null value in column \"network_id\" violates not-null constraint"
|
||||
OR message:"DBError: (IntegrityError) null value in column \"network_id\" violates not-null constraint" )
|
||||
AND filename:"logs/screen-q-svc.txt"
|
||||
- bug: 1239856
|
||||
query: >
|
||||
@message:"tempest/services" AND @message:"/images_client.py" AND @message:"wait_for_image_status"
|
||||
AND @tags:"console.html"
|
||||
(( @message:"tempest/services" AND @message:"/images_client.py" AND @message:"wait_for_image_status" )
|
||||
OR (message:"tempest/services" AND message:"/images_client.py" AND message:"wait_for_image_status" ))
|
||||
AND filename:"console.html"
|
||||
- bug: 1240256
|
||||
query: >
|
||||
@message:" 503" AND @fields.filename:"logs/syslog.txt"
|
||||
AND @fields.syslog_program:"proxy-server"
|
||||
( @message:" 503"
|
||||
OR message:" 503" )
|
||||
AND filename:"logs/syslog.txt"
|
||||
AND syslog_program:"proxy-server"
|
||||
|
|
Loading…
Reference in New Issue