Exemple #1
0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: disable=line-too-long
""" parser for dse output.log """
from pysper.parser.rules import switch, rule, convert, default
from pysper.parser.captures import output_capture_rule
from pysper.parser.cases import config_rules, dd_rules, daemon_rules

capture_message = switch((
    *daemon_rules(),
    *config_rules(),
    *dd_rules(),
))


def update_message(fields):
    """ updates message fields """
    subfields = None
    if 'source_file' in fields:
        subfields = capture_message(fields['source_file'][:-5],
                                    fields['message'])
    else:
        #need to handle the no source file output.log format
        if fields['message']:
            # dirty hack where it the message structure tells us what we want
            tokens = fields['message'].split()
Exemple #2
0
# Copyright 2020 DataStax, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
""" parser for systemlog returning gc messages only """
from pysper.parser.rules import switch, update_message, mkcapture
from pysper.parser.captures import system_capture_rule
from pysper.parser.cases import gc_rules

capture_message = switch((gc_rules()))
capture_line = mkcapture(system_capture_rule, update_message(capture_message))
Exemple #3
0
# Copyright 2020 DataStax, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

""" parser for dse system.log """
from pysper.parser.rules import switch, mkcapture, update_message
from pysper.parser.cases import gc_rules, memtable_rules, solr_rules, cfs_rules, daemon_rules, status_rules
from pysper.parser.captures import system_capture_rule

# pylint: disable=too-many-function-args
capture_message = switch((
    *daemon_rules(),
    *status_rules(),
    *gc_rules(),
    *memtable_rules(),
    *cfs_rules(),
    *solr_rules(),
))

capture_line = mkcapture(system_capture_rule, update_message(capture_message))
Exemple #4
0
""" parser for dse system.log """
from pysper.parser.rules import switch, mkcapture, update_message
from pysper.parser.cases import (
    gc_rules,
    memtable_rules,
    solr_rules,
    cfs_rules,
    daemon_rules,
    drop_rules,
    status_rules,
    tpc_rules,
    tombstone_rules,
    zc_rules,
)
from pysper.parser.captures import system_capture_rule

capture_message = switch((
    *daemon_rules(),
    *drop_rules(),
    *status_rules(),
    *gc_rules(),
    *memtable_rules(),
    *cfs_rules(),
    *solr_rules(),
    *tpc_rules(),
    *tombstone_rules(),
    *zc_rules(),
))

capture_line = mkcapture(system_capture_rule, update_message(capture_message))