def METHOD_NAME(self):
    """Tests that dynamic tags are extracted and converted."""
    config = yaml.safe_load(
        """yara_match_tagger:
        query_string: '_exists_:yara_match AND NOT yara_match.keyword:"-"'
        tags: ['yara', '$yara_match']
        modifiers: ['split']
        save_search: true
        search_name: 'Yara rule matches'"""
    )
    analyzer = tagger.TaggerSketchPlugin(
        "test_index",
        1,
        tag_config=config["yara_match_tagger"],
        tag="yara_match_tagger",
    )
    analyzer.datastore.client = mock.Mock()
    datastore = analyzer.datastore
    source_attributes = {
        "__ts_timeline_id": 1,
        "es_index": "",
        "es_id": "",
        "label": "",
        "timestamp": 1410895419859714,
        "timestamp_desc": "",
        "datetime": "2014-09-16T19:23:40+00:00",
        "source_short": "",
        "source_long": "",
        "message": "Dummy message",
        "yara_match": "rule1 rule2",
    }
    datastore.import_event("blah", source_attributes, "0")
    message = analyzer.run()
    self.assertEqual(
        sorted(analyzer.tagged_events["0"]["tags"]),
        sorted(["yara", "rule2", "rule1"]),
    )
    self.assertEqual(message, "1 events tagged for [yara_match_tagger]")