<?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 Autocreate an index in a docker container? in Installation</title>
    <link>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594690#M11469</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The docker container is started using splunk-ansible. You can configure some behavoirs of your container using environment variables, others using default.yml&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/splunk/splunk-ansible/blob/develop/docs/advanced/default.yml.spec.md" target="_blank"&gt;https://github.com/splunk/splunk-ansible/blob/develop/docs/advanced/default.yml.spec.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;use parameter&amp;nbsp;&lt;SPAN&gt;apps_location to install apps automatically at container startup.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/splunk/splunk-ansible/blob/37149df811538d589ab4740284d3a7264314d41f/docs/advanced/default.yml.spec.md?plain=1#L113" target="_blank"&gt;https://github.com/splunk/splunk-ansible/blob/37149df811538d589ab4740284d3a7264314d41f/docs/advanced/default.yml.spec.md?plain=1#L113&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can download them or present them on persistent storage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would create an app with indexes.conf containing your index configuration and configure it there.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
    <pubDate>Thu, 21 Apr 2022 14:37:01 GMT</pubDate>
    <dc:creator>schose</dc:creator>
    <dc:date>2022-04-21T14:37:01Z</dc:date>
    <item>
      <title>How to Autocreate an index in a docker container?</title>
      <link>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594554#M11466</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi folks.&lt;/P&gt;
&lt;P&gt;I'm attempting to run Splunk in a docker container.&amp;nbsp; Or rather, I have that working - it was pretty easy with docker-compose based on&amp;nbsp;&lt;A href="https://splunk.github.io/docker-splunk/EXAMPLES.html#create-standalone-from-compose" target="_blank" rel="noopener"&gt;https://splunk.github.io/docker-splunk/EXAMPLES.html#create-standalone-from-compose&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;However, I want to create an index automatically, when the container first starts up.&amp;nbsp; This I'm finding difficult.&lt;/P&gt;
&lt;P&gt;I've tried a variety of methods, but they all failed in one way or another:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;yum and dnf are missing from the container, and microdnf appears to be broken.&amp;nbsp; This makes it difficult to customize the container's configuration.&lt;/LI&gt;
&lt;LI&gt;The container so configured appears to be based on RHEL, and we don't have any RHEL entitlements.&amp;nbsp; This too makes it difficult to customize the container's behavior.&lt;/LI&gt;
&lt;LI&gt;I tried setting up a volume and adding a script that would start splunk and shortly thereafter add the index, but I found that Splunk was missing lots of config files this way.&amp;nbsp; This may or may not be due to my relative inexperience with docker.
&lt;UL&gt;
&lt;LI&gt;I invoked the script with the following in docker-compose.yml:
&lt;UL&gt;
&lt;LI&gt;entrypoint: /bin/bash&lt;/LI&gt;
&lt;LI&gt;command: /spunk-files/start&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;I needed to copy these files, which I didn't have to copy before the entrypoint+command change:
&lt;UL&gt;
&lt;LI&gt;$SPLUNK_HOME/etc/splunk-launch.conf&lt;/LI&gt;
&lt;LI&gt;$SPLUNK_HOME/etc/splunk.version&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;I also needed to create some logging directories, otherwise Splunk would fail to start.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;One of my favorite troubleshooting techniques, using a system call tracer like "strace", wasn't working because I couldn't install it - see above under microdnf.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Does anyone know of a good way to auto-create a Splunk index at container creation time, without an RHEL entitlement?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 14:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594554#M11466</guid>
      <dc:creator>dstromberg</dc:creator>
      <dc:date>2022-04-21T14:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Autocreate an index in a docker container?</title>
      <link>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594606#M11467</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I haven't tried something like this yet. But I think creating a persistent storage with the index config could help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://splunk.github.io/docker-splunk/STORAGE_OPTIONS.html" target="_blank"&gt;Data Storage ## | docker-splunk&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 08:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594606#M11467</guid>
      <dc:creator>smurf</dc:creator>
      <dc:date>2022-04-21T08:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Autocreate an index in a docker container?</title>
      <link>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594690#M11469</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The docker container is started using splunk-ansible. You can configure some behavoirs of your container using environment variables, others using default.yml&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/splunk/splunk-ansible/blob/develop/docs/advanced/default.yml.spec.md" target="_blank"&gt;https://github.com/splunk/splunk-ansible/blob/develop/docs/advanced/default.yml.spec.md&lt;/A&gt;&lt;/P&gt;&lt;P&gt;use parameter&amp;nbsp;&lt;SPAN&gt;apps_location to install apps automatically at container startup.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/splunk/splunk-ansible/blob/37149df811538d589ab4740284d3a7264314d41f/docs/advanced/default.yml.spec.md?plain=1#L113" target="_blank"&gt;https://github.com/splunk/splunk-ansible/blob/37149df811538d589ab4740284d3a7264314d41f/docs/advanced/default.yml.spec.md?plain=1#L113&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can download them or present them on persistent storage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would create an app with indexes.conf containing your index configuration and configure it there.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 14:37:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594690#M11469</guid>
      <dc:creator>schose</dc:creator>
      <dc:date>2022-04-21T14:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to Autocreate an index in a docker container?</title>
      <link>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594694#M11470</link>
      <description>&lt;P&gt;btw. here is an example for docker-compose using direct filesystem mapping&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;version: '3'
services:
  single:
    image: splunk/splunk:8.1.5
    ports:
      - "8111:8000"
    volumes:
      - single-etc:/opt/splunk/etc
      - single-var:/opt/splunk/var
      - /my/path/to/indexapp/indexapp:/opt/splunk/etc/apps/indexapp
    hostname: idx1
    environment:
      - SPLUNK_HOME=/opt/splunk/
     # - DEFAULTS_URL=http://splunk-defaults/default.yml
      - SPLUNK_START_ARGS="--accept-license"
      - SPLUNK_PASSWORD=EnterYourCreditCardNumber
      - SPLUNK_ROLE=splunk_standalone
      - SPLUNK_DEBUG="true"

volumes:
  single-etc:
  single-var:

networks:
  default:
    external:
      name: splunk&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 15:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/How-to-Autocreate-an-index-in-a-docker-container/m-p/594694#M11470</guid>
      <dc:creator>schose</dc:creator>
      <dc:date>2022-04-21T15:05:14Z</dc:date>
    </item>
  </channel>
</rss>

