<?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: Error with keyname conflicting with source. Can I retrieve the source key value? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289511#M3608</link>
    <description>&lt;P&gt;I tried but TERM is not working in this scenario as I have events like below:&lt;/P&gt;

&lt;P&gt;07/31/2013 15:38:18, field1=v1 field2=v2 field3=v3 07/31/2013 15:38:48, field1=v4 &lt;STRONG&gt;source=abcdef&lt;/STRONG&gt; field2=v5 field3=v6&lt;/P&gt;

&lt;P&gt;This will not work as source=abcdef has "=" as it is a minor break from the below reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/UseCASEandTERMtomatchphrases"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/UseCASEandTERMtomatchphrases&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2017 10:13:29 GMT</pubDate>
    <dc:creator>prosenjit2707</dc:creator>
    <dc:date>2017-10-09T10:13:29Z</dc:date>
    <item>
      <title>Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289508#M3605</link>
      <description>&lt;P&gt;Unfortunately, I have been indexing the events which have a key named "source" and splunk by default treat the key "source" as the source of the events.&lt;/P&gt;

&lt;P&gt;Now, when I am trying to retrieve the values from key "source", it is providing me the event source.&lt;/P&gt;

&lt;P&gt;Is there any way to retrieve the source key values from the events instead event sources(directories) or it is a bug/conflicts!&lt;/P&gt;

&lt;P&gt;Can anyone help me in this situation, how can I get the values without using regex/rex cmds?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 12:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289508#M3605</guid>
      <dc:creator>prosenjit2707</dc:creator>
      <dc:date>2017-10-06T12:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289509#M3606</link>
      <description>&lt;P&gt;You have multiple options I can see&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Use TERM in your search:  &lt;CODE&gt;&amp;lt;yourSearch&amp;gt; TERM(source=yoursourcevaluefromevent)&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Use rex to extract source under a different name: &lt;CODE&gt;| rex "source=(?&amp;lt;mySource&amp;gt;\w+)\s"&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Do a SEDCMD on ingest to change the field in your events to a different value&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 06 Oct 2017 17:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289509#M3606</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-06T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289510#M3607</link>
      <description>&lt;P&gt;@ssievert - Ooooo, I like &lt;CODE&gt;TERM()&lt;/CODE&gt;.  I haz a new toy!  Is Chrissmass!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 21:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289510#M3607</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-06T21:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289511#M3608</link>
      <description>&lt;P&gt;I tried but TERM is not working in this scenario as I have events like below:&lt;/P&gt;

&lt;P&gt;07/31/2013 15:38:18, field1=v1 field2=v2 field3=v3 07/31/2013 15:38:48, field1=v4 &lt;STRONG&gt;source=abcdef&lt;/STRONG&gt; field2=v5 field3=v6&lt;/P&gt;

&lt;P&gt;This will not work as source=abcdef has "=" as it is a minor break from the below reference:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/UseCASEandTERMtomatchphrases"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Search/UseCASEandTERMtomatchphrases&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 10:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289511#M3608</guid>
      <dc:creator>prosenjit2707</dc:creator>
      <dc:date>2017-10-09T10:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289512#M3609</link>
      <description>&lt;P&gt;Good point, although - interestingly enough - it works for me (V7). &lt;/P&gt;

&lt;P&gt;I think your best bet for solving this at search time is to create an inline field extraction for the affected sourcetype(s) that pulls out the values and renames the key. Simply upper-casing the first letter should be least intrusive.&lt;BR /&gt;
This allows you to not only search for the values, but also run reporting/statistics.&lt;BR /&gt;
Example in props.conf:&lt;BR /&gt;
    [yoursourcetype]&lt;BR /&gt;
    EXTRACT-Source = source=(?&lt;SOURCE&gt;[^[\s]+)&lt;/SOURCE&gt;&lt;/P&gt;

&lt;P&gt;You can also do it via the UI (Settings-&amp;gt;Fields-&amp;gt;Field Extractions). Make sure it is visible in the appropriate app context (Permissions).&lt;/P&gt;

&lt;P&gt;Cleanest would be to either change it at the log source or apply a SEDCMD at index time to modify _raw.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 21:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289512#M3609</guid>
      <dc:creator>s2_splunk</dc:creator>
      <dc:date>2017-10-09T21:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289513#M3610</link>
      <description>&lt;P&gt;Maybe I am missing it, but is this what you are looking for?&lt;/P&gt;

&lt;P&gt;source="=abcdef"&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 21:27:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289513#M3610</guid>
      <dc:creator>blacknight659</dc:creator>
      <dc:date>2017-10-09T21:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289514#M3611</link>
      <description>&lt;P&gt;Thanks for your response, Yes. I agreed with your option to change at props.conf itself. I tried in the field extractions, I did not got the proper values.&lt;/P&gt;

&lt;P&gt;Sometime, I have events with &lt;STRONG&gt;source="abcdef"&lt;/STRONG&gt; (i.e. values enclosed in inverted comma).&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289514#M3611</guid>
      <dc:creator>prosenjit2707</dc:creator>
      <dc:date>2017-10-10T10:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289515#M3612</link>
      <description>&lt;P&gt;Thank you for the response. But I am looking for all the possible values that comes under "source", but not from the default source (i.e. source=/opt/splunk/abc/xyz/log1.txt)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289515#M3612</guid>
      <dc:creator>prosenjit2707</dc:creator>
      <dc:date>2017-10-10T10:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289516#M3613</link>
      <description>&lt;P&gt;This is the optimum way that I can think of, as I do not have admin rights to change the config files.&lt;/P&gt;

&lt;P&gt;| rex "source=(?P\"?[^,]+)" | eval Source = lower(Source1)|chart count by Source&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 10:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289516#M3613</guid>
      <dc:creator>prosenjit2707</dc:creator>
      <dc:date>2017-10-10T10:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error with keyname conflicting with source. Can I retrieve the source key value?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289517#M3614</link>
      <description>&lt;P&gt;Ok, so you have two fields named "source" ?&lt;/P&gt;

&lt;P&gt;You are trying to search this data? NOT modify it at index time?&lt;/P&gt;

&lt;P&gt;If you are tying to search against the data, you will need to Eval or Rex it. Ultimately, you need get a little fancy to capture the values there. Ultimately, correcting this at index time is the best solution. &lt;/P&gt;

&lt;P&gt;If it were me, I would extract everything with the rex below, then search for all sources that do not have \ (since most sources have the \ to the directory of the log). &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=source "(?&amp;lt;newSourceName&amp;gt;[\w\W]*)"
| search newSourceName!="*\*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Oct 2017 15:52:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Error-with-keyname-conflicting-with-source-Can-I-retrieve-the/m-p/289517#M3614</guid>
      <dc:creator>blacknight659</dc:creator>
      <dc:date>2017-10-10T15:52:15Z</dc:date>
    </item>
  </channel>
</rss>

