<commit_before>#!/usr/bin/python

#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

#
# log
#
# Query log messages from analytics
#

import sys
import argparse
import json
import datetime
from opserver.opserver_util import OpServerUtils
from opserver.sandesh.vns.ttypes import Module
from opserver.sandesh.vns.constants import ModuleNames
import opserver.sandesh.viz.constants as VizConstants
from pysandesh.gen_py.sandesh.ttypes import SandeshType, SandeshLevel

OBJECT_TABLE_LIST = [table for table in VizConstants._OBJECT_TABLES]


class LogQuerier(object):

    def __init__(self):
        self._args = None
    # end __init__

    # Public functions
    def parse_args(self):
        """
        Eg. python log.py --opserver-ip 127.0.0.1
                          --opserver-port 8081
                          --source 127.0.0.1
                          --module bgp | cfgm | vnswad
                          --message-type UveVirtualMachineConfigTrace<commit_msg>Fix log.py imports<commit_after>#!/usr/bin/python

#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#

#
# log
#
# Query log messages from analytics
#

import sys
import argparse
import json
import datetime
from opserver.opserver_util import OpServerUtils
from sandesh_common.vns.ttypes import Module
from sandesh_common.vns.constants import ModuleNames
import opserver.sandesh.viz.constants as VizConstants
from pysandesh.gen_py.sandesh.ttypes import SandeshType, SandeshLevel

OBJECT_TABLE_LIST = [table for table in VizConstants._OBJECT_TABLES]


class LogQuerier(object):

    def __init__(self):
        self._args = None
    # end __init__

    # Public functions
    def parse_args(self):
        """
        Eg. python log.py --opserver-ip 127.0.0.1
                          --opserver-port 8081
                          --source 127.0.0.1
                          --module bgp | cfgm | vnswad
                          --message-type UveVirtualMachineConfigTrace
{'fraction_non_alphanumeric': 0.07816439737771054, 'fraction_numerical': 0.020171457387796268, 'mean_word_length': 2.4685314685314683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2929042', 'n_tokens_mistral': 629, 'n_tokens_neox': 592, 'n_words': 157}