<?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: Creating an interesting field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31880#M6619</link>
    <description>&lt;P&gt;You should be able to accomplish this by reading this documentation:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You'll eventually want to create a field extract in the Manager. But before you do, use the rex command to create a field extract on-the-fly. The '...' in the example below represents your search, then just tack-on the rex. 'user_id' can be any name you want it to be.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "^(?:[^ ]* ){2}(?&amp;lt;user_id&amp;gt;[^ ]+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first section skips the data and time fields, and the second part picks up the third field and assigns it to the field name 'user_id'. Then you can do the search, and look at your menu of field names, and click on the field to see what it is capturing.&lt;/P&gt;

&lt;P&gt;Once you have this working that way you want it to, take everything inside the quotes for the rex and put it into a new field extract via the manager.&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2013 23:03:48 GMT</pubDate>
    <dc:creator>wrangler2x</dc:creator>
    <dc:date>2013-05-13T23:03:48Z</dc:date>
    <item>
      <title>Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31879#M6618</link>
      <description>&lt;P&gt;I have a log set up as: timestamp, user account, query&lt;/P&gt;

&lt;P&gt;Splunk is not identifying the second column as 'user account' mostly because there isn't anything to identify it as a user account (no column title)....is there anyway to make Splunk read this column so that it will show as an interesting field regardless of the value? &lt;/P&gt;

&lt;P&gt;Log sample: &lt;BR /&gt;
2013-05-13 15:00:00,000 C012345(user account #)&lt;BR /&gt;
2013-05-13 15:00:00,000 C543210&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2013 21:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31879#M6618</guid>
      <dc:creator>cruzalan90</dc:creator>
      <dc:date>2013-05-13T21:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31880#M6619</link>
      <description>&lt;P&gt;You should be able to accomplish this by reading this documentation:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You'll eventually want to create a field extract in the Manager. But before you do, use the rex command to create a field extract on-the-fly. The '...' in the example below represents your search, then just tack-on the rex. 'user_id' can be any name you want it to be.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "^(?:[^ ]* ){2}(?&amp;lt;user_id&amp;gt;[^ ]+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first section skips the data and time fields, and the second part picks up the third field and assigns it to the field name 'user_id'. Then you can do the search, and look at your menu of field names, and click on the field to see what it is capturing.&lt;/P&gt;

&lt;P&gt;Once you have this working that way you want it to, take everything inside the quotes for the rex and put it into a new field extract via the manager.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2013 23:03:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31880#M6619</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2013-05-13T23:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31881#M6620</link>
      <description>&lt;P&gt;Something is still not right.&lt;/P&gt;

&lt;P&gt;The rex command is very close to what I'm looking for but it looks like timestamp and account ID are being identified as column 1. &lt;/P&gt;

&lt;P&gt;Right now: 2013-05-13 15:00:00,000 C012345 = Column 1&lt;/P&gt;

&lt;P&gt;Should be:&lt;BR /&gt;
2013-05-13 15:00:00,000 = Column 1&lt;BR /&gt;&lt;BR /&gt;
C012345 = Column 2&lt;/P&gt;

&lt;P&gt;I'm still fairly new to Splunk so what can I do to separate timestamp from account ID first before I can apply the rex command?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 14:25:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31881#M6620</guid>
      <dc:creator>cruzalan90</dc:creator>
      <dc:date>2013-05-14T14:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31882#M6621</link>
      <description>&lt;P&gt;I don't understand what you mean by column 1, so let's start with you posting some more information.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Let's see the actual search you are using.&lt;/LI&gt;
&lt;LI&gt;Let's see the search result (cut and paste) for one record.&lt;/LI&gt;
&lt;LI&gt;Let's see the raw data. To do this, on one record of the search result you click on the blue box with the white arrow to reveal a 3-item menu. Click on "show source" and then copy and paste the record that is highlighted.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 14 May 2013 15:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31882#M6621</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2013-05-14T15:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31883#M6622</link>
      <description>&lt;P&gt;As far as the rex goes, and in your example (2013-05-13 15:00:00,000 C012345) it is skipping 2013-05-13 and 15:00:00,000 and then picking up C012345 as a field extract under the label user_id. It does not affect the output of your search other than to make this field available by name, and then to appear under "Interesting Field(s)" unless you have selected it to appear in the "selected fields" list.&lt;/P&gt;

&lt;P&gt;Splunk should automagically have figured out the date field and the time fields. timestartpos shows where it sees these beginning (should be zero) and timeendpos where it ends. Also date_ fields.&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2013 15:32:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31883#M6622</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2013-05-14T15:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an interesting field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31884#M6623</link>
      <description>&lt;P&gt;What I meant by columns was referring to the actual logs.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;index = hrfarm | rex "^(?:[^ ]* ){2}(?&lt;ACCOUNT_ID&gt;[^ ]+)\s"&lt;/ACCOUNT_ID&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;2013-05-13 17:32:26,962 C083363 /* GUID: C083363 */ select permission1_.PermissionId as col_0_0_ from...&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Rex command works just not the correct position and when I change the position to either {1} or {3} its still not correct. &lt;/P&gt;

&lt;P&gt;Interesting field "account_ID"&lt;BR /&gt;
position {2} returns: GUID: or sometimes commands:&lt;BR /&gt;
position {1} returns: 2013-05-13 17:32:26,962 C083363 &lt;BR /&gt;
position {3} returns: GUID: C083363 (close but I want the first account ID value)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-an-interesting-field/m-p/31884#M6623</guid>
      <dc:creator>cruzalan90</dc:creator>
      <dc:date>2020-09-28T13:53:59Z</dc:date>
    </item>
  </channel>
</rss>

