test_class.file: hendrix-interceptors/interceptor-aws/src/test/java/io/symcpe/hendrix/interceptor/aws/TestVPCFlowLogParser.java
test_class.identifier: TestVPCFlowLogParser
test_case.body: @Test
  	public void testFlowLogParse() throws InterceptException {
  		VPCFlowLogParser parser = new VPCFlowLogParser();
  		String event = "{\"messageType\":\"DATA_MESSAGE\",\"owner\":\"123456789115\",\"logGroup\":\"vpc-flow-log-group\",\"logStream\""
  				+ ":\"eni-00fv0000-all\",\"subscriptionFilters\":[\"cloudwatch_flowlog_lambda_subscription\"],\"logEvents\":[{\"id\":\"327880164000000002313720044516500000000\",\"timestamp\":1470265507000,\"message\":\"2 123456789115 eni-0625b517 100.100.10.100 100.220.1.1 49162 5938 6 33 1848 1470265507 1470266096 ACCEPT OK\"},{\"id\":\"327880164000000002313720044516500000000\",\"timestamp\":123456789115,\"message\":\"2 686559647175 eni-0000b000 120.220.2.1 102.123.34.145 5938 49162 6 22 1144 1470265507 1470266096 ACCEPT OK\"}]}";
  		List<Map<String, Object>> result = parser.parseFlowLogMap(event);
  		assertEquals(2, result.size());
  	}
test_case.class_method_signature: TestVPCFlowLogParser.testFlowLogParse()
test_case.full_signature: @Test public void testFlowLogParse()
test_case.identifier: testFlowLogParse
test_case.invocations: parseFlowLogMap assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFlowLogParse()
focal_class.declarator: STATUS_CODE_ZERO = 'O'
focal_class.modifier: private static final
focal_class.original_string: private static final char STATUS_CODE_ZERO = 'O';
focal_class.type: char
focal_class.var_name: STATUS_CODE_ZERO
focal_class.declarator: MESSAGE = "message"
focal_class.modifier: private static final
focal_class.original_string: private static final String MESSAGE = "message";
focal_class.type: String
focal_class.var_name: MESSAGE
focal_class.declarator: ID = "id"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID = "id";
focal_class.type: String
focal_class.var_name: ID
focal_class.declarator: TIMESTAMP2 = "timestamp"
focal_class.modifier: private static final
focal_class.original_string: private static final String TIMESTAMP2 = "timestamp";
focal_class.type: String
focal_class.var_name: TIMESTAMP2
focal_class.declarator: TIMESTAMP = "@timestamp"
focal_class.modifier: private static final
focal_class.original_string: private static final String TIMESTAMP = "@timestamp";
focal_class.type: String
focal_class.var_name: TIMESTAMP
focal_class.declarator: LOG_EVENTS = "logEvents"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_EVENTS = "logEvents";
focal_class.type: String
focal_class.var_name: LOG_EVENTS
focal_class.declarator: LOG_STREAM = "logStream"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_STREAM = "logStream";
focal_class.type: String
focal_class.var_name: LOG_STREAM
focal_class.declarator: LOG_GROUP = "logGroup"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_GROUP = "logGroup";
focal_class.type: String
focal_class.var_name: LOG_GROUP
focal_class.declarator: ACCEPT = "ACCEPT"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCEPT = "ACCEPT";
focal_class.type: String
focal_class.var_name: ACCEPT
focal_class.declarator: LOG_STATUS = "log-status"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_STATUS = "log-status";
focal_class.type: String
focal_class.var_name: LOG_STATUS
focal_class.declarator: ACCEPTED = "accepted"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCEPTED = "accepted";
focal_class.type: String
focal_class.var_name: ACCEPTED
focal_class.declarator: END = "end"
focal_class.modifier: private static final
focal_class.original_string: private static final String END = "end";
focal_class.type: String
focal_class.var_name: END
focal_class.declarator: START = "start"
focal_class.modifier: private static final
focal_class.original_string: private static final String START = "start";
focal_class.type: String
focal_class.var_name: START
focal_class.declarator: BYTES = "bytes"
focal_class.modifier: private static final
focal_class.original_string: private static final String BYTES = "bytes";
focal_class.type: String
focal_class.var_name: BYTES
focal_class.declarator: PACKETS = "packets"
focal_class.modifier: private static final
focal_class.original_string: private static final String PACKETS = "packets";
focal_class.type: String
focal_class.var_name: PACKETS
focal_class.declarator: PROTOCOL = "protocol"
focal_class.modifier: private static final
focal_class.original_string: private static final String PROTOCOL = "protocol";
focal_class.type: String
focal_class.var_name: PROTOCOL
focal_class.declarator: DSTPORT = "dstport"
focal_class.modifier: private static final
focal_class.original_string: private static final String DSTPORT = "dstport";
focal_class.type: String
focal_class.var_name: DSTPORT
focal_class.declarator: SRCPORT = "srcport"
focal_class.modifier: private static final
focal_class.original_string: private static final String SRCPORT = "srcport";
focal_class.type: String
focal_class.var_name: SRCPORT
focal_class.declarator: DSTADDR = "dstaddr"
focal_class.modifier: private static final
focal_class.original_string: private static final String DSTADDR = "dstaddr";
focal_class.type: String
focal_class.var_name: DSTADDR
focal_class.declarator: SRCADDR = "srcaddr"
focal_class.modifier: private static final
focal_class.original_string: private static final String SRCADDR = "srcaddr";
focal_class.type: String
focal_class.var_name: SRCADDR
focal_class.declarator: INTERFACE_ID = "interface-id"
focal_class.modifier: private static final
focal_class.original_string: private static final String INTERFACE_ID = "interface-id";
focal_class.type: String
focal_class.var_name: INTERFACE_ID
focal_class.declarator: ACCOUNT_ID = "account-id"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCOUNT_ID = "account-id";
focal_class.type: String
focal_class.var_name: ACCOUNT_ID
focal_class.declarator: VERSION = "version"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION = "version";
focal_class.type: String
focal_class.var_name: VERSION
focal_class.declarator: FLOW_RECORD_REGEX = "(\\d)" // version
  			+ "\\s(.*)" // account-id
  			+ "\\s(.*-.*)" // interface-id
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // srcaddr
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // dstaddr
  			+ "\\s(\\d{1,5}|\\-)" // srcport
  			+ "\\s(\\d{1,5}|\\-)" // dstport
  			+ "\\s(\\d{1,3}|\\-)" // protocol
  			+ "\\s(\\d+|\\-)" // packets
  			+ "\\s(\\d+|\\-)" // bytes
  			+ "\\s(\\d+)" // start
  			+ "\\s(\\d+)" // end
  			+ "\\s(ACCEPT|REJECT|\\-)" // action
  			+ "\\s(OK|NODATA|SKIPDATA)"
focal_class.modifier: private static final
focal_class.original_string: private static final String FLOW_RECORD_REGEX = "(\\d)" // version
  			+ "\\s(.*)" // account-id
  			+ "\\s(.*-.*)" // interface-id
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // srcaddr
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // dstaddr
  			+ "\\s(\\d{1,5}|\\-)" // srcport
  			+ "\\s(\\d{1,5}|\\-)" // dstport
  			+ "\\s(\\d{1,3}|\\-)" // protocol
  			+ "\\s(\\d+|\\-)" // packets
  			+ "\\s(\\d+|\\-)" // bytes
  			+ "\\s(\\d+)" // start
  			+ "\\s(\\d+)" // end
  			+ "\\s(ACCEPT|REJECT|\\-)" // action
  			+ "\\s(OK|NODATA|SKIPDATA)";
focal_class.type: String
focal_class.var_name: FLOW_RECORD_REGEX
focal_class.declarator: FLOW_RECORD_PATTERN = Pattern.compile(FLOW_RECORD_REGEX)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern FLOW_RECORD_PATTERN = Pattern.compile(FLOW_RECORD_REGEX);
focal_class.type: Pattern
focal_class.var_name: FLOW_RECORD_PATTERN
focal_class.declarator: gson
focal_class.modifier: private
focal_class.original_string: private Gson gson;
focal_class.type: Gson
focal_class.var_name: gson
focal_class.file: hendrix-interceptors/interceptor-aws/src/main/java/io/symcpe/hendrix/interceptor/aws/VPCFlowLogParser.java
focal_class.identifier: VPCFlowLogParser
focal_class.class_method_signature: VPCFlowLogParser.VPCFlowLogParser()
focal_class.full_signature: public  VPCFlowLogParser()
focal_class.identifier: VPCFlowLogParser
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VPCFlowLogParser()
focal_class.class_method_signature: VPCFlowLogParser.parseFlowLogMap(String json)
focal_class.full_signature: public List<Map<String, Object>> parseFlowLogMap(String json)
focal_class.identifier: parseFlowLogMap
focal_class.modifiers: public
focal_class.parameters: (String json)
focal_class.return: List<Map<String, Object>>
focal_class.signature: List<Map<String, Object>> parseFlowLogMap(String json)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(Map<String, Object> map, String line)
focal_class.full_signature: public static void parseToRecord(Map<String, Object> map, String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Object> map, String line)
focal_class.return: void
focal_class.signature: void parseToRecord(Map<String, Object> map, String line)
focal_class.class_method_signature: VPCFlowLogParser.parseFlowLogJson(EventFactory factory, String json)
focal_class.full_signature: public List<Event> parseFlowLogJson(EventFactory factory, String json)
focal_class.identifier: parseFlowLogJson
focal_class.modifiers: public
focal_class.parameters: (EventFactory factory, String json)
focal_class.return: List<Event>
focal_class.signature: List<Event> parseFlowLogJson(EventFactory factory, String json)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(Event event, String line)
focal_class.full_signature: public static void parseToRecord(Event event, String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (Event event, String line)
focal_class.return: void
focal_class.signature: void parseToRecord(Event event, String line)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(String line)
focal_class.full_signature: public static VPCFlowLogRecord parseToRecord(String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (String line)
focal_class.return: VPCFlowLogRecord
focal_class.signature: VPCFlowLogRecord parseToRecord(String line)
focal_method.body: public List<Map<String, Object>> parseFlowLogMap(String json) throws InterceptException {
  		try {
  			List<Map<String, Object>> events = new ArrayList<>();
  			JsonObject flowLogs = gson.fromJson(json, JsonObject.class);
  			String logGroup = flowLogs.get(LOG_GROUP).getAsString();
  			String logStream = flowLogs.get(LOG_STREAM).getAsString();
  			for (JsonElement element : flowLogs.get(LOG_EVENTS).getAsJsonArray()) {
  				Map<String, Object> map = new LinkedHashMap<>();
  				JsonObject obj = element.getAsJsonObject();
  				map.put(LOG_GROUP, logGroup);
  				map.put(LOG_STREAM, logStream);
  				map.put(TIMESTAMP, obj.get(TIMESTAMP2).getAsLong());
  				map.put(ID, obj.get(ID).getAsString());
  				parseToRecord(map, obj.get(MESSAGE).getAsString());
  				events.add(map);
  			}
  			return events;
  		} catch (Exception e) {
  			throw new InterceptException(e);
  		}
  	}
focal_method.class_method_signature: VPCFlowLogParser.parseFlowLogMap(String json)
focal_method.full_signature: public List<Map<String, Object>> parseFlowLogMap(String json)
focal_method.identifier: parseFlowLogMap
focal_method.invocations: fromJson getAsString get getAsString get getAsJsonArray get getAsJsonObject put put put getAsLong get put getAsString get parseToRecord getAsString get add
focal_method.modifiers: public
focal_method.parameters: (String json)
focal_method.return: List<Map<String, Object>>
focal_method.signature: List<Map<String, Object>> parseFlowLogMap(String json)