<?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: How to extract data from CSV files? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655045#M226285</link>
    <description>&lt;P&gt;Thanks man!&lt;BR /&gt;&lt;BR /&gt;Now I will do some research on how to count the amount of days from a given date.&lt;BR /&gt;For example, I have a PATCH_DATE, that returns a date in the format 2023-07-12&amp;nbsp;(Y-M-D). If it is &amp;gt; than 30 the event should show up in the search... I have one event for each server...&lt;/P&gt;</description>
    <pubDate>Mon, 21 Aug 2023 14:53:49 GMT</pubDate>
    <dc:creator>tarcio_nieri</dc:creator>
    <dc:date>2023-08-21T14:53:49Z</dc:date>
    <item>
      <title>How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654402#M226113</link>
      <description>&lt;P&gt;hello team,&lt;/P&gt;
&lt;P&gt;I have data from CSV files coming into my Splunk instance, I can search and find that data.&lt;/P&gt;
&lt;P&gt;However, they come together in the "Event" field, and I would like to separate them based on a comma to create dashboards for servers that haven't been patched in over 30 days and haven't been restarted in over 30 days.&lt;BR /&gt;&lt;BR /&gt;So I use the following search:&lt;/P&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;LI-CODE lang="markup"&gt;index="index_name" host=hostname source="path_to_file/file.csv" sourcetype="my_source"&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I get the results as follows:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="How I see the event." style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/26797i5495DFE2181D33BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="tempsnip.png" alt="How I see the event." /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;How I see the event.&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm new to using the tool so I'm a bit overwhelmed by the amount of information, so I'm not sure which way to go.&lt;/P&gt;
&lt;P&gt;Is it possible to do this just using Splunk Commands?&lt;BR /&gt;&lt;BR /&gt;Note: As you can see I have hidden the real information about the servers, IPs and other names for compliance purposes.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 21:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654402#M226113</guid>
      <dc:creator>tarcio_nieri</dc:creator>
      <dc:date>2023-08-15T21:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654419#M226118</link>
      <description>&lt;P&gt;If you are ingesting CSV fields with a header, then Splunk will normally auto extract those field names as the CSV fields.&lt;/P&gt;&lt;P&gt;On the left hand side of that event image do you have a list of the field names? If you search in verbose mode, Splunk will show you all the fields that it has extracted during the search.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Aug 2023 23:34:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654419#M226118</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-08-15T23:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654449#M226126</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259688"&gt;@tarcio_nieri&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;have you all fields correctly extracted or not?&lt;/P&gt;&lt;P&gt;if yes, you have only to use them, if not you have to add to your props.conf (in the server where you configured input) INDEXED_EXTRACTIONS=csv.&lt;/P&gt;&lt;P&gt;In this way, you automatically extract the fields.&lt;/P&gt;&lt;P&gt;If you didn't use this approach, you could make a copy of your csv file and manually ingest using the Add-Data Feature of the Settings manu.&lt;/P&gt;&lt;P&gt;In this way you'll be guided in the props.conf building.&lt;/P&gt;&lt;P&gt;In addition, you could search some document or video on internet, like the following:&lt;/P&gt;&lt;P&gt;&lt;A href="https://hurricanelabs.com/splunk-tutorials/ingesting-a-csv-file-into-splunk/" target="_blank"&gt;https://hurricanelabs.com/splunk-tutorials/ingesting-a-csv-file-into-splunk/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=3kx0OGKy_XU" target="_blank"&gt;https://www.youtube.com/watch?v=3kx0OGKy_XU&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Getting-Data-In/How-can-I-configure-Splunk-to-read-a-csv-file-from-a-universal/m-p/170522" target="_blank"&gt;https://community.splunk.com/t5/Getting-Data-In/How-can-I-configure-Splunk-to-read-a-csv-file-from-a-universal/m-p/170522&lt;/A&gt;&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 16 Aug 2023 09:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/654449#M226126</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-16T09:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655034#M226281</link>
      <description>&lt;P&gt;Thanks for the suggestions guys, I will test and mark the one that helps me.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 13:07:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655034#M226281</guid>
      <dc:creator>tarcio_nieri</dc:creator>
      <dc:date>2023-08-21T13:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655045#M226285</link>
      <description>&lt;P&gt;Thanks man!&lt;BR /&gt;&lt;BR /&gt;Now I will do some research on how to count the amount of days from a given date.&lt;BR /&gt;For example, I have a PATCH_DATE, that returns a date in the format 2023-07-12&amp;nbsp;(Y-M-D). If it is &amp;gt; than 30 the event should show up in the search... I have one event for each server...&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 14:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655045#M226285</guid>
      <dc:creator>tarcio_nieri</dc:creator>
      <dc:date>2023-08-21T14:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655055#M226290</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259688"&gt;@tarcio_nieri&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 15:43:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655055#M226290</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-21T15:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data from CSV files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655057#M226291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/259688"&gt;@tarcio_nieri&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;this is another question on a different topic.&lt;/P&gt;&lt;P&gt;In this case, please open a new question, in this way you'll surely have a bettere and faster solution.&lt;/P&gt;&lt;P&gt;Anyway, to compare dates, you have to convert them in epochtime using the eval command with the strptime function, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval PATCH_DATE_epoch=strptime(PATCH_DATE,"%Y-%m-%d")
| where PATCH_DATE_epoch&amp;gt;86400*30  &lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 15:47:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data-from-CSV-files/m-p/655057#M226291</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-08-21T15:47:46Z</dc:date>
    </item>
  </channel>
</rss>

