<?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: Field name changed while indexing csv file in splunk in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/658411#M9704</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you have some fields with and without the ., below is an example of how to get that to work.&lt;/P&gt;&lt;P&gt;However it only works going into an event index, it does not seem to work going into metrices.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[test_abc_transforms]
CLEAN_KEYS = false
DELIMS=,
FIELDS=degraded.threshold,down.threshold

[drop_header]
REGEX = metric_timestamp,metric_name,_value,degraded\.threshold,down\.threshold
DEST_KEY = queue
FORMAT = nullQueue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;metric_timestamp,metric_name,_value,degraded.threshold,down.threshold
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Sep 2023 11:34:53 GMT</pubDate>
    <dc:creator>robertlynch2020</dc:creator>
    <dc:date>2023-09-22T11:34:53Z</dc:date>
    <item>
      <title>Why did the field name change while indexing csv file in splunk?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337028#M5664</link>
      <description>&lt;P&gt;I am trying to index a csv file by uploading it through splunk web.... while setting up sourcetype i could see all my field names become changed&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;field.project become field_project&lt;/P&gt;
&lt;P&gt;Can somebody help me in this?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 17:52:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337028#M5664</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2023-09-22T17:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Field name changed while indexing csv file in splunk</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337029#M5665</link>
      <description>&lt;P&gt;By default, Splunk replaces non alphanumeric characters in field names with underscore:&lt;/P&gt;

&lt;P&gt;From &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Configureadvancedextractionswithfieldtransforms"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.0/Knowledge/Configureadvancedextractionswithfieldtransforms&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; CLEAN_KEYS

Controls whether the system strips leading underscores and 0-9 characters from the field names it extracts. Key cleaning is the practice of replacing any non-alphanumeric characters in field names with underscores, as well as the removal of leading underscores and 0-9 characters from field names.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could try set it to false for your sourcetype transforms.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 13:01:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337029#M5665</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2017-12-12T13:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Field name changed while indexing csv file in splunk</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337030#M5666</link>
      <description>&lt;P&gt;Sorry i m totally new to this....&lt;BR /&gt;
Can you help me in creating this transforms.conf file. not sure what should be the stanza name&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2017 14:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337030#M5666</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2017-12-12T14:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Field name changed while indexing csv file in splunk</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337031#M5667</link>
      <description>&lt;P&gt;Here is the test csv I am using:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;field.name,field.value&lt;BR /&gt;
field1,splunk&lt;BR /&gt;
field2,answers&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;If you ingest the file using the sourcetype detected by Splunk (that will be csv here), it will use indexed extractions and replace "field.attr" with "field_attr". It is not possible to prevent Splunk from doing that at indexing time (as far as i know).&lt;/P&gt;

&lt;P&gt;So you need to turn index extractions off. I used the following props.conf / transforms.conf:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test_abc]
SHOULD_LINEMERGE = false
disabled = false
INDEXED_EXTRACTIONS=
REPORT-no_clean_keys = test_abc_transforms
TRANSFORMS-drop_header = drop_header
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test_abc_transforms]
CLEAN_KEYS = false
DELIMS=,
FIELDS=field.name,field.value

[drop_header]
REGEX = field\.name,field\.value
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;test_abc_transforms&lt;/EM&gt; extracts fields from your csv and tell Splunk not to clean the keys (replace "." with "_" in this case).&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;drop_header&lt;/EM&gt; transform is to tell Splunk not to index the header of your CSV file.&lt;/P&gt;

&lt;P&gt;Restart Splunk then ingest your file using Splunk CLI:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/splunk add oneshot path/to/your/csv/abc.csv -sourcetype test_abc -index main&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It worked for me, let me know if you need further help.&lt;BR /&gt;
Also i welcome anyone reading this solution to suggest any ameliorations, there may be better ways to achieve that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337031#M5667</guid>
      <dc:creator>damien_chillet</dc:creator>
      <dc:date>2020-09-29T17:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Field name changed while indexing csv file in splunk</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337032#M5668</link>
      <description>&lt;P&gt;Thanks So much its working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 11:47:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/337032#M5668</guid>
      <dc:creator>sivaranjiniG</dc:creator>
      <dc:date>2017-12-18T11:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Field name changed while indexing csv file in splunk</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/658411#M9704</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If you have some fields with and without the ., below is an example of how to get that to work.&lt;/P&gt;&lt;P&gt;However it only works going into an event index, it does not seem to work going into metrices.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[test_abc_transforms]
CLEAN_KEYS = false
DELIMS=,
FIELDS=degraded.threshold,down.threshold

[drop_header]
REGEX = metric_timestamp,metric_name,_value,degraded\.threshold,down\.threshold
DEST_KEY = queue
FORMAT = nullQueue&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;metric_timestamp,metric_name,_value,degraded.threshold,down.threshold
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300
1695201472,mx.process.cpu.utilization,1.373348018,30,300&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2023 11:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Why-did-the-field-name-change-while-indexing-csv-file-in-splunk/m-p/658411#M9704</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2023-09-22T11:34:53Z</dc:date>
    </item>
  </channel>
</rss>

