<commit_before>package com.wizecore.graylog2.plugin;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import org.graylog2.plugin.Message;
import org.graylog2.syslog4j.SyslogIF;
import org.graylog2.syslog4j.impl.message.structured.StructuredSyslogMessage;

/**
 * https://tools.ietf.org/html/rfc5424
 * 
 * <165>1 2003-10-11T22:14:15.003Z mymachine.example.com
           evntslog - ID47 [exampleSDID@0 iut="3" eventSource=
           "Application" eventID="1011"] BOMAn application
           event log entry...

 */
public class FullSender implements MessageSender {
	private Logger log = Logger.getLogger(FullSender.class.getName());

	@Override
	public void send(SyslogIF syslog, int level, Message msg) {		
		Map<String, String> sdParams = new HashMap<String, String>();
		Map<String, Object> fields = msg.getFields();
		for (String key: fields.keySet()) {
			sdParams.put(key, fields.get(key).toString());
		}
		
		// http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
		// <name>@<enterpriseId>
		String sdId = "all@0";
		// log.info("Sending " + level + ", " + msg.getId() + ", " + msg.getSource() + ", " + sdId + "=" + sdParams + ", " + msg.getMessage());
		Map<String,Map<String,String>> sd = new HashMap<String, Map<String,String>>();
		sd.put(sdId, sdParams);
		<commit_msg>Added comment to FullSender class<commit_after>package com.wizecore.graylog2.plugin;

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger;

import org.graylog2.plugin.Message;
import org.graylog2.syslog4j.SyslogIF;
import org.graylog2.syslog4j.impl.message.structured.StructuredSyslogMessage;

/**
 * Sends full message to Syslog.
 * 
 * <165>1 2003-10-11T22:14:15.003Z <EMAIL>
           evntslog - ID47 [exampleSDID@0 iut="3" eventSource=
           "Application" eventID="1011"] BOMAn application
           event log entry...

 */
public class FullSender implements MessageSender {
	private Logger log = Logger.getLogger(FullSender.class.getName());

	@Override
	public void send(SyslogIF syslog, int level, Message msg) {		
		Map<String, String> sdParams = new HashMap<String, String>();
		Map<String, Object> fields = msg.getFields();
		for (String key: fields.keySet()) {
			sdParams.put(key, fields.get(key).toString());
		}
		
		// http://www.iana.org/assignments/enterprise-numbers/enterprise-numbers
		// <name>@<enterpriseId>
		String sdId = "all@0";
		// log.info("Sending " + level + ", " + msg.getId() + ", " + msg.getSource() + ", " + sdId + "=" + sdParams + ", " + msg.getMessage());
		Map<String,Map<String,String>> sd = new HashMap<String, Map<String,String>>();
		sd.put(sdId, sdParams);
		
{'fraction_non_alphanumeric': 0.15695067264573992, 'fraction_numerical': 0.028400597907324365, 'mean_word_length': 4.0319548872180455, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, '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': '4643467', 'n_tokens_mistral': 974, 'n_tokens_neox': 901, 'n_words': 174}