<commit_before>#!/usr/bin/env python
"""

   PhantomIngest.py 

   This is a modification to the sample REST API Ingest routing published in the 
   Phantom REST APIs https://127.0.0.1/docs/rest/overview documentation.
   It was modified to be imported as a python class for consumption.

   Copyright (c) 2016 World Wide Technology, Inc.
   All rights reserved.

   author: <EMAIL>

   Revision history:
     5 August 2016  |  1.0 - initial release
     22 Aug   2016  |  1.1 - Conditionally Disable InsecureRequestWarning due to backlevel python on APIC

"""

import sys, os
import time
import getpass
import requests
import json


class PhantomIngest(object):
    "Ingest data to Phantom via the REST API"

    def __init__(self, phantom_host, token):
        " The container and artifact common fields can be overridden by using kwargs when calling the method."

        self.headers = {"ph-auth-token": token}
        self.url =  "https://%s/rest" % phantom_host
        self.container_id = None
        self.content = None
        self.message = None

        self.container_common = {"description": "A brief useful description of the behavior tracked by this container",
                                 "name": "A short friendly name for the container",
                                 "label":"intelligence",
                                 "sensitivity": "red",
                                 "severity": "high",
                                 "tags": ['atomic_counters']
                                }

        self.artifact_common = {"description": "A textual description of the artifact",
                                "name": "A human friendly name for the artifact",
                                "tags": ['atomic_counters'],
                                "type": "network",<commit_msg>modified "label" to "events" to avoid 400 errors in default configuration<commit_after>#!/usr/bin/env python
"""

   PhantomIngest.py 

   This is a modification to the sample REST API Ingest routing published in the 
   Phantom REST APIs https://127.0.0.1/docs/rest/overview documentation.
   It was modified to be imported as a python class for consumption.

   Copyright (c) 2019 World Wide Technology
   All rights reserved.

   author: <EMAIL>

"""

import sys, os
import time
import getpass
import requests
import json


class PhantomIngest(object):
    "Ingest data to Phantom via the REST API"

    def __init__(self, phantom_host, token):
        " The container and artifact common fields can be overridden by using kwargs when calling the method."

        self.headers = {"ph-auth-token": token}
        self.url =  "https://%s/rest" % phantom_host
        self.container_id = None
        self.content = None
        self.message = None

        self.container_common = {"description": "A brief useful description of the behavior tracked by this container",
                                 "name": "A short friendly name for the container",
                                 "label":"events",
                                 "sensitivity": "red",
                                 "severity": "high",
                                 "tags": ['atomic_counters']
                                }

        self.artifact_common = {"description": "A textual description of the artifact",
                                "name": "A human friendly name for the artifact",
                                "tags": ['atomic_counters'],
                                "type": "network",
{'fraction_non_alphanumeric': 0.08411747932706017, 'fraction_numerical': 0.010835471913316224, 'mean_word_length': 1.8427876823338736, 'pattern_counts': {'":': 22, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '490500', 'n_tokens_mistral': 934, 'n_tokens_neox': 829, 'n_words': 323}