<?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: create permanent field via rest api in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451862#M78325</link>
    <description>&lt;P&gt;I am trying this&lt;BR /&gt;
curl -k -u admin:pass &lt;A href="https://localhost:8089/servicesNS/admin/search/data/props/extractions"&gt;https://localhost:8089/servicesNS/admin/search/data/props/extractions&lt;/A&gt; -d name=image  -d stanza=openstack -d type=EXTRACT -d "value= ^(?:[^\.\n]*\.){6}(?P[^ ]+)"&lt;BR /&gt;
 I can see this extracted field in field extraction but when I see my dataset "openstack" with search app ,it is not coming as interesting field in left side.i want to see it permanently as interested field.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Feb 2019 09:55:00 GMT</pubDate>
    <dc:creator>snigdha9nov</dc:creator>
    <dc:date>2019-02-04T09:55:00Z</dc:date>
    <item>
      <title>create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451860#M78323</link>
      <description>&lt;P&gt;can permanent field be created  by using regular expression via rest api?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 06:57:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451860#M78323</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-04T06:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451861#M78324</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can you please clarify "permanent field" ? If you want to create props.conf configuration to extract field using REST API then have a look at this answer &lt;A href="https://answers.splunk.com/answers/688049/how-do-i-alter-propsconf-via-python-sdk.html"&gt;https://answers.splunk.com/answers/688049/how-do-i-alter-propsconf-via-python-sdk.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 09:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451861#M78324</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-04T09:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451862#M78325</link>
      <description>&lt;P&gt;I am trying this&lt;BR /&gt;
curl -k -u admin:pass &lt;A href="https://localhost:8089/servicesNS/admin/search/data/props/extractions"&gt;https://localhost:8089/servicesNS/admin/search/data/props/extractions&lt;/A&gt; -d name=image  -d stanza=openstack -d type=EXTRACT -d "value= ^(?:[^\.\n]*\.){6}(?P[^ ]+)"&lt;BR /&gt;
 I can see this extracted field in field extraction but when I see my dataset "openstack" with search app ,it is not coming as interesting field in left side.i want to see it permanently as interested field.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 09:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451862#M78325</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-04T09:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451863#M78326</link>
      <description>&lt;P&gt;Looks like your regex is wrong or splunk answers website removed certain part of regex. Always use &lt;CODE&gt;101010&lt;/CODE&gt; button when posting code or regex.&lt;/P&gt;

&lt;P&gt;Can you please confirm your regex, is this &lt;CODE&gt;^(?:[^\.\\n]*\.){6}(?P[^ ]+)&lt;/CODE&gt; OR &lt;CODE&gt;^(?:[^\.\\n]*\.){6}(?P&amp;lt;ext_field&amp;gt;[^ ]+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451863#M78326</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-04T10:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451864#M78327</link>
      <description>&lt;P&gt;I am trying to use this command from splunk rest api reference manual&lt;BR /&gt;
curl -k -u admin:pass &lt;A href="https://localhost:8089/servicesNS/admin/search/data/props/extractions"&gt;https://localhost:8089/servicesNS/admin/search/data/props/extractions&lt;/A&gt; -d name=port -d stanza=ftp_log -d type=EXTRACT -d "value=port (?\d+)"&lt;/P&gt;

&lt;P&gt;but confused with "value=port (?\d+)" what is "port"  before regular expression&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:38:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451864#M78327</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-04T10:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451865#M78328</link>
      <description>&lt;P&gt;That is part of regular expression which should match something like &lt;CODE&gt;port 1234&lt;/CODE&gt; and from this match it will extract &lt;CODE&gt;1234&lt;/CODE&gt; in &lt;CODE&gt;port_number&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451865#M78328</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-04T10:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451866#M78329</link>
      <description>&lt;P&gt;so if I want to extract field by regex I want to give name"image"...how should be the command&lt;BR /&gt;
stanza =  openstack(source or source type)&lt;BR /&gt;
type =Extract&lt;BR /&gt;
value=??&lt;BR /&gt;
name??&lt;BR /&gt;
what should be name and value&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 10:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451866#M78329</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-04T10:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451867#M78330</link>
      <description>&lt;P&gt;In &lt;CODE&gt;stanza&lt;/CODE&gt; you need to provide host,source or sourcetype. I guess if you want to provide host or source then stanza should be like &lt;CODE&gt;host::yourhostname&lt;/CODE&gt; or &lt;CODE&gt;source::yoursourcename&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In &lt;CODE&gt;value&lt;/CODE&gt; you need to provide your regular expression, let's say your _raw data is &lt;CODE&gt;This is myimage&lt;/CODE&gt; and you want to extract &lt;CODE&gt;myimage&lt;/CODE&gt; in &lt;CODE&gt;image&lt;/CODE&gt; field then your regular repression should be like this &lt;CODE&gt;^(?:[^\h]*[\h]){2}(?&amp;lt;image&amp;gt;[^\v]*)$&lt;/CODE&gt; , sample data with regex &lt;A href="https://regex101.com/r/3G2UsI/1"&gt;https://regex101.com/r/3G2UsI/1&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;In &lt;CODE&gt;name&lt;/CODE&gt;, it will be user friendly name for this configuration(stanza).&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 11:33:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451867#M78330</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-04T11:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451868#M78331</link>
      <description>&lt;P&gt;Are you sure host::yourhostname or source::source name is a correct way for stanza...&lt;BR /&gt;
I mentioned stanza=mysoucename..and can see my extracted field in field extractions in same way as I did in splunkweb page with regex. ..but unable to see it on left side as interesting field.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 06:12:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451868#M78331</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-05T06:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451869#M78332</link>
      <description>&lt;P&gt;Yes I am sure, for host and source you need to use &lt;CODE&gt;host::yourhostname&lt;/CODE&gt; and &lt;CODE&gt;source::yoursourcename&lt;/CODE&gt;, for sourcetype you do not need to use any prefix. &lt;/P&gt;

&lt;P&gt;For sourcetype you can use &lt;CODE&gt;stanza=yoursourcetype&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 09:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451869#M78332</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-05T09:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451870#M78333</link>
      <description>&lt;P&gt;okk..thanks a lot....i was getting stuck with it.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 09:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451870#M78333</guid>
      <dc:creator>snigdha9nov</dc:creator>
      <dc:date>2019-02-05T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: create permanent field via rest api</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451871#M78334</link>
      <description>&lt;P&gt;Summarizing comments into answer.&lt;/P&gt;

&lt;P&gt;To create props configuration using &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.3/RESTREF/RESTknowledge#data.2Fprops.2Fextractions"&gt;REST API&lt;/A&gt; , below parameter require.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;name - User friendly name of the stanza.&lt;/LI&gt;
&lt;LI&gt;stanza - Here you can define stanza based on host, source or sourcetype.  For host, stanza will be &lt;CODE&gt;stanza="host::yourhostname&lt;/CODE&gt;, for source stanza will be &lt;CODE&gt;stanza="source::yoursource"&lt;/CODE&gt; and for sourcetype you do not need to provide any prefix so stanza will be &lt;CODE&gt;stanza=yoursourcetype&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;type - Depend on your requirement, if you want to use transforms.conf then specify &lt;CODE&gt;REPORT&lt;/CODE&gt; or if you want to use Inline regex then specify &lt;CODE&gt;EXTRACT&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;value - For Inline REGEX (Aka EXTRACT) provide your regular expression for example : &lt;CODE&gt;"value=^(?:[^\h]*[\h]){2}(?&amp;lt;image&amp;gt;[^\v]*)$"&lt;/CODE&gt; or if you want to use transforms (Aka REPORT) then provide comma or space delimited transforms list.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;For example: I have raw data &lt;CODE&gt;This is myimage&lt;/CODE&gt; with sourcetype &lt;CODE&gt;mysourcetype&lt;/CODE&gt; and I want to extract &lt;CODE&gt;myimage&lt;/CODE&gt; word from raw data in &lt;CODE&gt;image&lt;/CODE&gt; field then we can use below curl to fire POST REST API, below curl command will create Private Field Extractions in search app and owner will be admin user.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -vk -u admin:pass &lt;A href="https://localhost:8089/servicesNS/admin/search/data/props/extractions" target="test_blank"&gt;https://localhost:8089/servicesNS/admin/search/data/props/extractions&lt;/A&gt; -d name=test -d stanza=mysourcetype -d type=EXTRACT -d "value=^(?:[^\h]*[\h]){2}(?&amp;lt;image&amp;gt;[^\v]*)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Feb 2019 09:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/create-permanent-field-via-rest-api/m-p/451871#M78334</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-02-05T09:32:03Z</dc:date>
    </item>
  </channel>
</rss>

