this is my sample xml file-
<appender name="SYSTEMLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<file>${cassandra.logdir}/system.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${cassandra.logdir}/system.log.%i.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>20</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>20MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-5level [%thread] %date{ISO8601} %F:%L - %msg%n</pattern>
</encoder>
</appender>
<!-- DEBUGLOG rolling file appender to debug.log (all levels) -->
<appender name="DEBUGLOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${cassandra.logdir}/debug.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${cassandra.logdir}/debug.log.%i.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>20</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>20MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%-5level [%thread] %date{ISO8601} %F:%L - %msg%n</pattern>
</encoder>
</appender>
I want to replace -
<file>${cassandra.logdir}/system.log</file>
<fileNamePattern>${cassandra.logdir}/system.log.%i.zip</fileNamePattern>
${cassandra.logdir}/system.log with /var/log/cassandra/system.log
and similarly tag
<file>${cassandra.logdir}/debug.log</file>
<fileNamePattern>${cassandra.logdir}/debug.log.%i.zip</fileNamePattern>
${cassandra.logdir}/debug.log with /var/log/cassandra/debug.log
i tried several method using sed but not able to achieve this. please help me on this to figure out the solution using sed command which i am using in my shell script.
${cassandra.logdir}
with/var/log/cassandra
? How about a simplesed 's_${cassandra.logdir}_/var/log/cassandra_g
?