<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Insert custom field and value to splunk in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/615005#M14039</link>
    <description>&lt;P&gt;I think that you must add search time extraction for that field, otherwise it use = as key value separator. Just add it to search head with props.conf or with gui.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2022 13:21:59 GMT</pubDate>
    <dc:creator>isoutamo</dc:creator>
    <dc:date>2022-09-28T13:21:59Z</dc:date>
    <item>
      <title>How do I Insert custom field and value to splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614978#M14032</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Im dummy in Splunk and I have one doubt. Maybe you can help me.&lt;BR /&gt;&lt;BR /&gt;I want to insert in an index that I have created some data that I have obtained when executing a script in python, so the result of the script is the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;sourcetype="script_emails" mail_sender="jordi@jordilazo.com" mail_recipient="jordilazo2@jordilazo.es" mail_date="10-10-2022" mail_subject="RE: NMXWZFOG&amp;lt; &amp;gt;VSTI" mail_reviewcomment="Comment:ÑC&amp;lt;AZR=@P"&amp;amp;"\A"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I configure the inputs, props and transform so that it is uploaded correctly in Splunk?&lt;/P&gt;
&lt;P&gt;- Field - Value&lt;BR /&gt;- Source&lt;BR /&gt;- Sourcetype&lt;BR /&gt;&lt;BR /&gt;I have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;inputs.conf&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;[script://"script.py"]
disabled = 0
index = python_emails
interval = 22 13 * * *
source = ????(I dont know what to insert here)
sourcetype = mytest&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;transform.conf&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;[test_sourcetype]
REGEX = sourcetype="(\w+)"
FORMAT = sourcetype::$1
DEST_KEY = MetaData:Sourcetype

[test_comment]
REGEX = mail_reviewcomment="(.+)"
FORMAT = mail_reviewcomment::$1
WRITE_META = true&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[mytest]
SHOULD_LINEMERGE = false
NO_BINARY_CHECK = true
TIME_PREFIX = timestamp=
MAX_TIMESTAMP_LOOKAHEAD = 10
CHARSET = UTF-8
KV_MODE = auto
TRANSFORMS-test_sourcetype = test_sourcetype,test_comment&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for you help!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 18:00:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614978#M14032</guid>
      <dc:creator>jordilazo</dc:creator>
      <dc:date>2022-09-28T18:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Insert custom field and value to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614988#M14034</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you want you can add source and sourcetype to inputs.conf. If not then splunk use script name for those.&lt;/P&gt;&lt;P&gt;f you have several source types returned by this script (which actually means that output of this script is different) then you should use those transforms.conf settings. You can also look INGEST_EVAL command to pick up those values from input stream.&lt;/P&gt;&lt;P&gt;If/when you are not setting sourcetype on inputs.conf you must change in [mytest] to [source::.../&amp;lt;script.py&amp;gt;] or [script.py] &amp;nbsp;to match those events. &amp;nbsp;&lt;/P&gt;&lt;P&gt;You have defined that timestamp (_time) has picked from field timestamp, but I don't see it on your script output. If it's missing then ok otherwise change the filename for it (mail_date?) and check that you have correctly formatted TIME_FORMAT for it.&lt;/P&gt;&lt;P&gt;Test the script by running it on source host as "sudo -u&amp;lt;splunk user&amp;gt; /opt/splunk/bin/splunk cmd /path/to/your/script". This must work to use it as an scripted inputs. &amp;nbsp;Maybe you need to change the path in your inputs.conf stanza if it cannot find it by "script.py".&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 12:19:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614988#M14034</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-09-28T12:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Insert custom field and value to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614999#M14036</link>
      <description>&lt;P&gt;Hi isoutamo,&lt;BR /&gt;&lt;BR /&gt;Thanks for your information!!&lt;/P&gt;&lt;P&gt;Thanks to you I have been able to upload the data correctly except for a small error.&lt;BR /&gt;In the field: &lt;STRONG&gt;mail_reviewcomment&lt;/STRONG&gt; I have a &lt;STRONG&gt;=&lt;/STRONG&gt; which makes splunk automatically create a new field for me without me asking it.&lt;BR /&gt;Is there any way to be able to insert the = symbol to the splunk and at the same time not create a new field? Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 12:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/614999#M14036</guid>
      <dc:creator>jordilazo</dc:creator>
      <dc:date>2022-09-28T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Insert custom field and value to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/615005#M14039</link>
      <description>&lt;P&gt;I think that you must add search time extraction for that field, otherwise it use = as key value separator. Just add it to search head with props.conf or with gui.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/615005#M14039</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-09-28T13:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert custom field and value to splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/615012#M14042</link>
      <description>&lt;P&gt;Sorry is the first time I am doing this.&lt;BR /&gt;&lt;BR /&gt;Could you explain it with more detail?&lt;BR /&gt;&lt;BR /&gt;Where should I add EXTRACT? as you said in the props.conf but exactly where and with what parameters?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2022 13:44:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-do-I-Insert-custom-field-and-value-to-splunk/m-p/615012#M14042</guid>
      <dc:creator>jordilazo</dc:creator>
      <dc:date>2022-09-28T13:44:04Z</dc:date>
    </item>
  </channel>
</rss>

