Ejemplo n.º 1
0
  def __init__(self):
    geo_ip_operation = get_operator("geo_ip").get_default_operation()

    geo_ip_operation['settings']["/country/names/en"] = True
    geo_ip_operation['settings']["/city/names/en"] = True
    geo_ip_operation['settings']["/location/latitude"] = True
    geo_ip_operation['settings']["/location/longitude"] = True

    geo_ip_operation['fields'] += [
      Field("country", "string").to_dict(),
      Field("city", "string").to_dict(),
      Field("latitude", "double").to_dict(),
      Field("longitude", "double").to_dict()
    ]

    self._fields = [
      Field("date", "date"),
      Field("component", "string"),
      Field("log_level", "string"),
      Field("details", "string"),
      Field("message", "text_en"),
      Field("ip", "string", [geo_ip_operation]),
      Field("user", "string"),
      Field("http_method", "string"),
      Field("path", "string"),
      Field("protocol", "string")
    ]
Ejemplo n.º 2
0
  def __init__(self):
    geo_ip_operation = get_operator("geo_ip").get_default_operation()

    geo_ip_operation['settings']["/country/names/en"] = True
    geo_ip_operation['settings']["/city/names/en"] = True
    geo_ip_operation['settings']["/location/latitude"] = True
    geo_ip_operation['settings']["/location/longitude"] = True

    geo_ip_operation['fields'] += [
      Field("country", "string").to_dict(),
      Field("city", "string").to_dict(),
      Field("latitude", "double").to_dict(),
      Field("longitude", "double").to_dict()
    ]

    self._fields = [
      Field("date", "date"),
      Field("component", "string"),
      Field("log_level", "string"),
      Field("details", "string"),
      Field("message", "text_en"),
      Field("ip", "string", [geo_ip_operation]),
      Field("user", "string"),
      Field("http_method", "string"),
      Field("path", "string"),
      Field("protocol", "string")
    ]
Ejemplo n.º 3
0
  def test_generate_geo_ip_morphline(self):
    geo_ip_dict = get_operator('geo_ip').get_default_operation()

    geo_ip_dict['fields'] = [
        Field("test_field_1", "string").to_dict(),
        Field("test_field_2", "string").to_dict()
      ]

    _test_generate_field_operation_morphline(geo_ip_dict)
Ejemplo n.º 4
0
  def test_generate_extract_uri_components_operation_morphline(self):
    extract_uri_dict = get_operator('extract_uri_components').get_default_operation()

    extract_uri_dict['fields'] = [
        Field("test_field_1", "string").to_dict(),
        Field("test_field_2", "string").to_dict()
      ]

    _test_generate_field_operation_morphline(extract_uri_dict)
Ejemplo n.º 5
0
  def test_generate_split_operation_morphline(self):
    split_dict = get_operator('split').get_default_operation()

    split_dict['fields'] = [
        Field("test_field_1", "string").to_dict(),
        Field("test_field_2", "string").to_dict()
      ]

    _test_generate_field_operation_morphline(split_dict)
Ejemplo n.º 6
0
    def test_generate_geo_ip_morphline(self):
        geo_ip_dict = get_operator('geo_ip').get_default_operation()

        geo_ip_dict['fields'] = [
            Field("test_field_1", "string").to_dict(),
            Field("test_field_2", "string").to_dict()
        ]

        _test_generate_field_operation_morphline(geo_ip_dict)
Ejemplo n.º 7
0
    def test_generate_split_operation_morphline(self):
        split_dict = get_operator('split').get_default_operation()

        split_dict['fields'] = [
            Field("test_field_1", "string").to_dict(),
            Field("test_field_2", "string").to_dict()
        ]

        _test_generate_field_operation_morphline(split_dict)
Ejemplo n.º 8
0
    def test_generate_extract_uri_components_operation_morphline(self):
        extract_uri_dict = get_operator(
            'extract_uri_components').get_default_operation()

        extract_uri_dict['fields'] = [
            Field("test_field_1", "string").to_dict(),
            Field("test_field_2", "string").to_dict()
        ]

        _test_generate_field_operation_morphline(extract_uri_dict)
Ejemplo n.º 9
0
  def test_generate_translate_morphline(self):
    translate_dict = get_operator('translate').get_default_operation()

    translate_dict['fields'] = [
      Field("test_field_1", "string").to_dict(),
      Field("test_field_2", "string").to_dict()
    ]

    translate_dict['settings']['mapping'].append({"key":"key","value":"value"})

    _test_generate_field_operation_morphline(translate_dict)
Ejemplo n.º 10
0
    def test_generate_translate_morphline(self):
        translate_dict = get_operator('translate').get_default_operation()

        translate_dict['fields'] = [
            Field("test_field_1", "string").to_dict(),
            Field("test_field_2", "string").to_dict()
        ]

        translate_dict['settings']['mapping'].append({
            "key": "key",
            "value": "value"
        })

        _test_generate_field_operation_morphline(translate_dict)
Ejemplo n.º 11
0
  def test_generate_find_replace_morphline(self):
    find_replace_dict = get_operator('find_replace').get_default_operation()

    _test_generate_field_operation_morphline(find_replace_dict)
Ejemplo n.º 12
0
  def test_generate_convert_date_morphline(self):
    convert_date_dict = get_operator('convert_date').get_default_operation()

    _test_generate_field_operation_morphline(convert_date_dict)
Ejemplo n.º 13
0
    def test_generate_find_replace_morphline(self):
        find_replace_dict = get_operator(
            'find_replace').get_default_operation()

        _test_generate_field_operation_morphline(find_replace_dict)
Ejemplo n.º 14
0
    def test_generate_convert_date_morphline(self):
        convert_date_dict = get_operator(
            'convert_date').get_default_operation()

        _test_generate_field_operation_morphline(convert_date_dict)